version_1:
def find_nb(m):
# your code
ii = 1
total = 0
while total < m:
total = sum(each**3 for each in range(ii))
ii += 1
if total == m:
result = ii-2
else:
result = -1
return result
version_2:
def find_nb(m):
# your code
i = 1
while m>0:
m = m - i**3
i += 1
return -1 if m<0 else i-1