Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
magic numbers 70,21,15 solution in Speedy category for Number Guess by Sim0000
def checkio(x):
if len(x) <= 3 : return (3, 5, 7)[len(x) - 1], 99
return 9, (70*x[1][0] + 21*x[2][0] + 15*x[3][0]) % 105
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
checkio([(1, 5)]) # the number has a remainder 1
checkio([(1, 5), (1, 2)]) # the number has a remainder 1
checkio([(1, 5), (1, 2), (2, 3)]) # the number has a remainder 2
checkio([(1, 5), (1, 2), (2, 3), (5, 6)]) # the number has a remainder 5
checkio([(1, 5), (1, 2), (2, 3), (5, 6), (3, 4)]) # the number has a remainder 3
March 6, 2014