Questions tagged [north-east-lattice-path]

Use this tag for walking graphs in a north and/or east only direction. Also sometimes described as a up and right walk.

References

Wikipedia - North-East lattice paths

2 questions
1
vote
3 answers

CLPFD and recursive formulations

Given a field, find the "cheapest" path from (0, 0) to (3, 3). Only the moves up and to the right are allowed. field([ [1, 1, 1, 1], [3, 3, 4, 3], [3, 3, 1, 3], [3, 3, 1, 1] ]). nth([A|_], 0, A). nth([_|T], I, A) :- I #> 0, J #= I - 1,…
vasily
  • 2,850
  • 1
  • 24
  • 40
0
votes
1 answer

Hackerrank Lattice Paths in Javascript

I am working on the project euler lattice path problem in Javascript. I used the recursive method and solved it in project euler. Below is my function, const latticePathsRecursive = (m, n = m) => { if (m < 0 || n < 0) return 0; if (m === 0…
SangyK
  • 799
  • 2
  • 6
  • 16