You are viewing a single comment's thread. Return to all comments →
my very easy cpp solution
int beautifulDays(int i, int j, int k) {
int rem,count=0,temp; for(int m=i;m <=j ; m++){///for looping temp=m; int rev=0; while(temp > 0){ rem = temp % 10; rev = (rev * 10 ) + rem; temp = temp/10; //for reversing number } if(abs(m - rev) % k ==0){ \\for checking it is equallly divisible or not 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 →
my very easy cpp solution
int beautifulDays(int i, int j, int k) {
}