You are viewing a single comment's thread. Return to all comments →
static boolean isStrange(long x){ long length = String.valueOf(x).length(); if (length == 1) return true; if ((x%length == 0) && isStrange(x/length)) return true; return false; } static int solve(long l, long r) { int count = 0; for (long i = l; i<=r; i++) if (isStrange(i)) count++; return count; }
Seems like cookies are disabled on this browser, please enable them to open this website
Strange numbers
You are viewing a single comment's thread. Return to all comments →