We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
public static int beautifulDays(int i, int j, int k) {
int count = 0;
for (int m = i; m <= j; m++) {
int n = m;
int reversed = 0;
while (n != 0) {
reversed = reversed * 10 + n % 10;
n /= 10;
}
if (Math.abs(m - reversed) % k == 0) {
count++;
}
}
return count;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Beautiful Days at the Movies
You are viewing a single comment's thread. Return to all comments →
Here my java solution
public static int beautifulDays(int i, int j, int k) { int count = 0;
}