Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

build a pile of cubes python

def find_nb(m):
    total = 0
    n = 0
    
    while (total < m):
        n = n + 1
        total = total + n ** 3
        
    return n if total == m else -1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #build #pile #cubes #python
ADD COMMENT
Topic
Name
7+9 =