You are viewing a single comment's thread. Return to all comments →
I used this recursive code but not passing all test cases:
def hrank(x, k): if 0 <= x < k: return 1 elif (x >= k) and (x % k == 0): return (hrank(x - k, k) + hrank(x / k, k)) else: return hrank(x-1, k) k, x = map(int, raw_input().split()) print hrank(x, k)
Seems like cookies are disabled on this browser, please enable them to open this website
Calculate It
You are viewing a single comment's thread. Return to all comments →
I used this recursive code but not passing all test cases: