Amazon | Phone | Consecutive combinations of size 2
Anonymous User
948

Say you have

[['a', 'pen', 10],
 ['a', 'paper', 20],
 ['b', 'paper', 25],
 ['a', 'paper', 28],
 ['b', 'eraser', 29],
 ['b', 'eraser', 30],
 ['b', 'eraser', 39]]

return all consecutive combinations of size 2 by the same user

['pen', 'paper'] - 1
['paper', 'paper'] - 1 # by a
['paper', 'eraser'] - 1
['eraser', 'eraser'] - 2
Comments (3)