If my input a = [3.0, 4.0, 2.5, 2.5, 3.0]
,
There are two 3.0, one 4.0, and two 2.5
As you can see, a[0] = a[4]
, a[1]
is just by itself, and a[2] = a[3]
I want my output as [[0,4], [1], [2,3]]
How would I code this? Is there a built-in function to do this? If not, any hint or suggestion? Thank you.