[subject line]
First impl

[Bug input/output]
None

[Fix]
Use HashMap as histgraph and three loop layers
Very easy to forget hisgraph updates
There might be duplicate non-consecutive results

[Bug input/output]
[-4,-2,-2,-2,0,1,2,2,2,3,3,4,4,6,6] [[-4,-2,6],[-4,0,4],[-4,1,3],[-4,2,2],[-2,-2,4],[-2,0,2],[-2,-2,4],[-2,0,2]]    [[-4,-2,6],[-4,0,4],[-4,1,3],[-4,2,2],[-2,-2,4],[-2,0,2]]

[Fix]
add continue check if sort[i-1] == sort[i]
[subject line]
simple iteration repeation does not work

[Bug input/output]
[0,0,0] []  [[0,0,0]]

[Fix]
The last used should be at the time of correct solution being used instead of iteration time
[subject line]
LastUsed reference should be at right scope and reset accordingly

[Bug input/output]
[3,0,-2,-1,1,2] [[-2,-1,3],[-2,0,2]]    [[-2,-1,3],[-2,0,2],[-1,0,1]]

Put LastUsed right before the corresponding loop