Problem 1049. Path of least resistance
Solution Stats
Problem Comments
-
1 Comment
Cool problem. Optimal solutions sometimes appear if moving up is enabled.
Solution Comments
-
4 Comments
functional programming approach
Congratulations.
Honestly, I have difficulties with this kind of algorithm. I have the feeling that you only increment i or j, but at the end you check all the matrix.
Thanks, Jean-Marie. This solution uses recursive calls of the function. So all elements of the matrix are processed.
If you would like to learn more about functional programming principles, I recommend 'Functional Programming Principles in Scala' course by Martin Odersky at Coursera. It starts soon. Actually, I wrote this solution after taking the course a year ago. It is very interesting to look at the same problem from different points of view.
Thanks for your advice.
Problem Recent Solvers64
Suggested Problems
-
Calculate the area of a triangle between three points
2209 Solvers
-
Multiples of a Number in a Given Range
496 Solvers
-
Replace multiples of 5 with NaN
415 Solvers
-
3852 Solvers
-
Project Euler: Problem 18, Maximum path sum I
80 Solvers
More from this Author5
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!