You are viewing a single comment's thread. Return to all comments →
static int beautifulDays(int i, int j, int k)
{ int count=0; for(int x=i;x<=j;x++) { if(Math.abs(x-reverse(x))%k==0) count++; } return count; } static int reverse(int a) { int n=0,k=0; while(a!=0) { k=a%10; n=n*10+k; a=a/10; } return n; }
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 →
static int beautifulDays(int i, int j, int k)