http://tafakuri.net/?p=66

def num_paths_to_grid_bottom(numRowCells, numColumnCells):
       currRow = [1 for x in range(numColumnCells + 1)]
       # the number of nodes to consider = numRowCells + 1
       for numRow in range(1, numRowCells + 1):
           for numColumn in range(1, numColumnCells + 1):
               currRow[numColumn] += currRow[numColumn - 1]
       return currRow[numColumnCells]

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to