Two sum: Difference between revisions

m
(→‎AppleScript Functional: Tidied. Added note on indices.)
Line 87:
{{Trans|JavaScript}}
{{Trans|Haskell}}
 
 
Nesting concatMap or (>>=) (flip concatMap) yields the cartesian product of the list with itself. Skipping products where the y index is lower than the x index (see the use of 'drop' below) ignores the 'lower triangle' of the cartesian grid, excluding mirror-image and duplicate number pairs.
9,655

edits