It would be more elegant to define the solution for the 1x1 case as 1 rather than 0.
agree, but will leave as so, so as to not affect submitted solutions.
I disagree with the base case. A 1x1 matrix has 1 path. And, the empty matrix has no path (zero).
The first test case has been changed from 0 to 1 without rescoring past solutions.
The first test case is incorrect. The null path (starting and ending at the same place) is a solution. The 1x1 case should have 1 solution.
Summing Digits within Text
Project Euler: Problem 6, Natural numbers, squares and sums.
Spot the outlier
Sum the entries of each column of a matrix which satisfy a logical condition.
Set a diagonal
Method of Common Differences part-2
Game of Nim
nth Rational Number
Disjunctive Normal Form
Find the treasures in MATLAB Central and discover how the community can help you!
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office