#3783
Mirror Distance of an Integer
easy · 87.5% accepted · 54 likes · top 98%
Description
You are given an integer n.
Define its mirror distance as: abs(n - reverse(n)) where reverse(n) is the integer formed by reversing the digits of n.
Return an integer denoting the mirror distance of n.abs(x) denotes the absolute value of x.
Solution