1 min read

APL Hacking: Project Euler (#18)

You notice that these are not daily anymore. :)

For this one, I took advantage of the ability to rotate vectors to get the job done. I am confused about the use of the bracket indexing though, and I do not quite understand why I needed to use ⊃ and ⊂ as much as I did.

Problem #18:


⍝ Find the greatest total through a triangle M


⊣⎕FX 'R←X BEST Y' 'R←(X+Y)⌈1⌽Y+-1⌽X'