Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

the grandest staircase of them all foobar solution

def solution(n):
    m = [[0 for i in range(n + 1)] for j in range(n + 1)]
    m[0][0] = 1  # base case
    for stair in range(1, n + 1):
	    for left in range(0, n + 1):
	        m[stair][left] = m[stair - 1][left]
	        if left >= stair:
	            m[stair][left] += m[stair - 1][left - stair]
	          	
    return m[n][n] -1
Comment

PREVIOUS NEXT
Code Example
Python :: Issue TypeError: ‘numpy.float64’ object cannot be interpreted as an integer 
Python :: django how to delete a db field 
Python :: remove cooldown discord python 
Python :: Kinesis Client get_records example 
Python :: python to open .seg file 
Python :: pagerank formula 
Python :: how to find projectile angle from distance python 
Python :: Python Key Gen 
Python :: how to see if something is in a class in python 
Python :: python which packages depend on package 
Python :: Scope, Global Variables and Global Keyword 
Python :: Herons rule python 
Python :: How to make bot commands case insensitive in discord.py 
Python :: xtick for axvline 
Python :: k and M to int in pandas 
Python :: the entire bee movie script but backwards 
Python :: matplotlib set dpi 300 
Python :: pydictionary 
Python :: how to make a config txt file on python 
Python :: loops with variables that count 
Python :: Ranking in Pyspark 
Python :: sns regplot make the line and confidence interval thicker 
Python :: Handling single exception 
Python :: least square fit straight line python 
Python :: python csv row index is empty 
Python :: Scopes and Namespaces Example in python 
Python :: .all() python numpy 
Python :: tkinter call function in mainloop 
Python :: how to add colors in python 
Python :: shuffle function in python 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =