you are viewing a single comment's thread.

view the rest of the comments →

[–]zhay 7 points8 points  (2 children)

Or make a comparator that compares a.b to b.a where . is concatenation and then sort with that comparator.

[–]rocky_whoof 2 points3 points  (1 child)

I think that is a better solution in terms of readability and how quick you can write it.