Fun Amazon Coding Test in Python

by Security Dude

from Lynn Root ‏@roguelynn

import string
magic = [12,-12,25,-11,-1]
out = [ 1 - reduce(lambda x, y: x+y, magic[1:])]
map (lambda x: out.append(out[-1]+x), magic)
print ''.join(map(lambda x: string.uppercase[x], out))
Advertisements