5 kyu

Minimum path in squares

115 of 449Frederikbh

Description:

You're given a square consisting of random numbers, like so:

var square = [
    [1,2,3],
    [4,8,2],
    [1,5,3]];

Your job is to calculate the minimum total cost when moving from the upper left corner to the coordinate given. You're only allowed to move right or down.

In the above example the minimum path would be:

var square = [
    [1,2,3],
    [_,_,2],
    [_,_,3]];

Giving a total of 11. Start and end position are included.

Note: Coordinates are marked as x horizontally and y vertically.

Dynamic Programming
Algorithms

Stats:

CreatedDec 5, 2016
PublishedDec 5, 2016
Warriors Trained1454
Total Skips111
Total Code Submissions2765
Total Times Completed449
JavaScript Completions115
C# Completions58
Java Completions146
Python Completions163
Total Stars57
% of votes with a positive feedback rating92% of 118
Total "Very Satisfied" Votes103
Total "Somewhat Satisfied" Votes12
Total "Not Satisfied" Votes3
Total Rank Assessments9
Average Assessed Rank
5 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • Frederikbh Avatar
  • smile67 Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
Ad