Skip to content

Instantly share code, notes, and snippets.


Oleksandr Rohachev alex-rogachev

View GitHub Profile
alex-rogachev / solution.rb
Last active Feb 28, 2019
Minimum grid path solution
View solution.rb
# Given a m x n grid filled with non-negative numbers, find a path from top left
# to bottom right which minimizes the sum of all numbers along its path.
def minimum_path_sum(grid)
m, n = detect_grid_size(grid)
validate_grid!(grid, n)
# Prepare table that contains path cost
path_cost = { { 0 } }
You can’t perform that action at this time.