runar-rkmedia / gotally

0 stars 1 forks source link

sortable solution #24

Open runar-rkmedia opened 1 year ago

runar-rkmedia commented 1 year ago

These two solutions are equal, and we should be able to see them as equal. Having the functionality to sort these indexes would be great. They would need to be sorted by neighbor first, so that they still produce a valid path.

"indexes:7,6,3,4;indexes:2,5,4;indexes:0,1,4;",
"indexes:3,6,7,4;indexes:2,5,4;indexes:0,1,4;",

A test could be written that takes in a set of indexes, and sorts them in a stable manner that still ensures it is a valid path. The last item in the index must still be at the same index, as that is the target.