say I want to compute a pair-wise diff for all the elements in the array. input: [1, 2, 4, 7, 8] output: [1, 2, 3, 1]
is there some kind of "beautiful" way of doing it? i.e. w/o using a for loop nor using explicit indecies
say I want to compute a pair-wise diff for all the elements in the array. input: [1, 2, 4, 7, 8] output: [1, 2, 3, 1]
is there some kind of "beautiful" way of doing it? i.e. w/o using a for loop nor using explicit indecies