You are viewing a single comment's thread. Return to all comments →
Here is my Python solution!
def decentNumber(n): nums = list(reversed([i for i in range(n // 3 + 1)])) for num in nums: if (n - (3 * num)) % 5 == 0: print(3 * num * "5" + (n - 3 * num) * "3") return print(-1)
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Sherlock and The Beast
You are viewing a single comment's thread. Return to all comments →
Here is my Python solution!