Rather than sorting based on a-z, is it possible to sort based on occurrence?
Example of desired task,
Input =
Example
Example
Hello
Hello
Input
Input
List
List
World
World
...
Desired output =
Example
Hello
Input
List
World
Example
Hello
Input
List
World
...
So in this scenario it gets the first occurrence of each line and puts them in order, then the second occurrence of each line and puts them in order until there's no more occurences