You are viewing a single comment's thread. Return to all comments →
check this one, Its easy to understand
int beautifulDays(int i, int j, int k) { int num,count=0,gn; int quo, newNum = 0, x = 0; for (int x = i; x <= j ; x++) { num = x; newNum = 0; //For reversing no while (num != 0) { quo = num % 10; newNum = 10 * newNum + quo; num = num / 10; } gn = abs(x- newNum); if (gn%k==0) { count++; } } return count; }
Seems like cookies are disabled on this browser, please enable them to open this website
Beautiful Days at the Movies
You are viewing a single comment's thread. Return to all comments →
check this one, Its easy to understand