Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Pure magic after zip spell solution in Creative category for The Secret Room by Merzix
def secret_room(n):
low = [0, 1, 2, 2, 1, 1, 4, 4, 1, 4, 8, 2, 11, 10, 5, 3, 11, 10, 2, 9]
high = [0, 51, 200, 188, 37, 26, 364, 352, 2, 339, 551]
middle = [0, 8, 19, 17, 6, 5, 35, 33, 3, 40]
return high[n // 100] + (low[n % 100] if (n % 100) < len(low) else middle[n % 100 // 10] + low[n % 10])
if __name__ == '__main__':
assert secret_room(0) == 0
assert secret_room(1) == 1
assert secret_room(2) == 2
assert secret_room(200) == 200
assert secret_room(201) == 201
assert secret_room(202) == 202
Sept. 13, 2018
Comments: