You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/6rYwcW6BYH4
int beautifulDays(int i, int j, int k) { int ans = 0; for(int el = i; el <= j; el++){ string s = to_string(el); reverse(s.begin(), s.end()); if(abs(stoi(s) -el ) % k == 0) ans++; } return ans; }
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 →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/6rYwcW6BYH4