stderr:
Traceback (most recent call last):
File "/workspace/default/tests.py", line 13, in
test.assert_equals(complete_binary_tree(a), [a[i] for i in [6, 3, 8, 1, 5, 7, 9, 0, 2, 4]])
File "/workspace/default/tests.py", line 13, in
test.assert_equals(complete_binary_tree(a), [a[i] for i in [6, 3, 8, 1, 5, 7, 9, 0, 2, 4]])
IndexError: list index out of range
The test is:
a = [randrange(10) for i in range(10)]
test.assert_equals(complete_binary_tree(a), [a[i] for i in [6, 3, 8, 1, 5, 7, 9, 0, 2, 4]])
God damn....
Thank you
This recursive relation is correct for any base, height and modulo(if you apply it correctly too, as per the description)
"However, tower(13, 3, 31) == pow(13, tower(13, 2, 30), 31)."
Is this correct for only b=13,h=3,m=31 or for all inputs?
.
The test.assert_equals(complete_binary_tree(a), [a[i] for i in [6, 3, 8, 1, 5, 7, 9, 0, 2, 4]])
Isn't fixed yet for python
I get an error when testing random numbers:
stderr:
Traceback (most recent call last):
File "/workspace/default/tests.py", line 13, in
test.assert_equals(complete_binary_tree(a), [a[i] for i in [6, 3, 8, 1, 5, 7, 9, 0, 2, 4]])
File "/workspace/default/tests.py", line 13, in
test.assert_equals(complete_binary_tree(a), [a[i] for i in [6, 3, 8, 1, 5, 7, 9, 0, 2, 4]])
IndexError: list index out of range
The test is:
a = [randrange(10) for i in range(10)]
test.assert_equals(complete_binary_tree(a), [a[i] for i in [6, 3, 8, 1, 5, 7, 9, 0, 2, 4]])