You are viewing a single comment's thread. Return to all comments →
can you pls explain this line
it's the main logic of our program.
it is for checking if the day is beautiful or not.
here we are checking if the difference of the number and its reverse can be evenly divided by k.
whenever the difference of a and reverse a is divisible by the k no. then the count will increase and hence we will get the required result.
Math.abs() is used to avoid negative result .
Hope this helps!