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
Similar Kata:
Stats:
Created | Dec 5, 2016 |
Published | Dec 5, 2016 |
Warriors Trained | 1454 |
Total Skips | 111 |
Total Code Submissions | 2765 |
Total Times Completed | 449 |
JavaScript Completions | 115 |
C# Completions | 58 |
Java Completions | 146 |
Python Completions | 163 |
Total Stars | 57 |
% of votes with a positive feedback rating | 92% of 118 |
Total "Very Satisfied" Votes | 103 |
Total "Somewhat Satisfied" Votes | 12 |
Total "Not Satisfied" Votes | 3 |
Total Rank Assessments | 9 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 3 kyu |
Lowest Assessed Rank | 6 kyu |