I've been racking my brain over this and I just can't come up with an elegant solution.
Imagine you have a list of ten books that you need to rank 1-10. You can rank them in any order and when you rank one, if that rank is already taken, the list needs to reshuffle.
for example:
A 1
B -
C -
D 4
E -
F 6
if F goes to one, it should look like:
F 1
A 2
B -
C -
D 4
E -
F 6
Any ideas would be GREATLEY appreciated.