Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Ooooo solution in Creative category for Ghosts Age by MagiMaster
def checkio(ooooo):
o = (ooooo + ooooo)//ooooo
oo = (o*o*o + o) ** (o*o)
ooo = [o-o, o//o, o//o]
oooo = o-o
while o:
if ooooo == oo:
return oooo
oooo += o//o
if oooo == ooo[o]:
oo -= oooo
ooo = [ooo[o//o], ooo[o], ooo[o//o] + ooo[o]]
else:
oo += o//o
#These "asserts" using only for self-checking and not necessary for auto-testing
if __name__ == '__main__':
assert checkio(10000) == 0, "Newborn"
assert checkio(9999) == 1, "1 year"
assert checkio(9997) == 2, "2 years"
assert checkio(9994) == 3, "3 years"
assert checkio(9995) == 4, "4 years"
assert checkio(9990) == 5, "5 years"
April 15, 2014
Comments: