You are viewing a single comment's thread. Return to all comments →
def getRidOf0Prefix(strNumber): for idx in range(len(strNumber)): if strNumber != "0": return strNumber[idx:] return "0" def isBeautifulDays(strNumber, k): numerator = int(strNumber) - int(getRidOf0Prefix(strNumber[::-1])) calc = numerator / k return True if calc == int(calc) else False def beautifulDays(i, j, k): res = 0 for idx in range(i, j+1): if isBeautifulDays(str(idx), k): res += 1 return res
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 →
Python3 Solution