Two sum: Difference between revisions

2 bytes removed ,  3 years ago
m
→‎version 2: used a better comment.
m (→‎version 2: added/changed comments and whitespace.)
m (→‎version 2: used a better comment.)
Line 2,093:
say /* [↓] look for sum of 2 numbers=target*/
do a=0 for # /*scan up to the last number in array. */
do b=a+1 to #-1; if @.a + @.b\=targ then iterate /*is sumSum not correct? Skip.*/
sol= sol + 1 /*bump count of the number of solutions*/
say @solution center( "["right(a, L)',' right(b, L)"]", L+L+5) ,
right(@.a, w*4) " + " right(@.b, w) ' = ' targ
end /*b*/ /*show the 2 indices and the summation.*/
end /*a*/