Your job is to create the slowest growing function you can in no more than 100 bytes.
Your program will take as input a nonnegative integer, and output a nonnegative integer. Let's call your program P.
It must meet the these two criterion:
Its source code must be less than or equal to 100 byt...
class ord:
def check(val):
if type(val) == list:
return all(ord.check(x) for x in val)
return False
def le(a, b):
if a == []:
return True
if b == []:
return False
if a[0] == b[0]:
return ord.le(a[1:],b[1:])
if ord.le(a[0],b[0]):
return True
return False
def str(a):
if a == []:
return "1"
if len(a) == 1:
return "\u03c9^"+ord.str(a[0])
return "+".join(ord.str(x) for x in a)
def __init__(self, *val):
val = list(val)
assert(ord.check(val))
self.val = []
def __init__(self, *val):
val = list(val)
assert(ord.check(val))
self.val = []
curr_max = 0
for a in val:
if curr_max != 0 and ord.le(a,curr_max):
self.val.append(curr_max)
if a != curr_max:
curr_max = 0
curr_max = a
self.val.append(val[-1])