re: Coding Puzzles: Week of 4/8 VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Friday (CodeJam): Foregone Solution codingcompetitions.withgoogle.com/...
 
n_cases = int(input())
for i in range(1, n_cases + 1):
    check_amount = int(input())
    unfound = True
    fours = [int(i) for i in str(check_amount)]
    others = ["1" if n == 4 else "0" for n in fours]
    n = int(''.join(others))
    print("Case #{}: {} {}".format(i, n, check_amount - n))
code of conduct - report abuse