this is the array:
[[1,0], [3,4], [2,1], [4,5], [0,2], [5,3]]
Become like this:
[[1,0], [0,2], [2,1]]
[[3,4], [4,5], [5,3]]
I want to write a program, and I want to know if there are clever ways and logic to do it.
EDIT: The above example contains two "chains" (10 02 21 and 34 45 53). In all “chains”, each number pair can only appear once.