# [Brachylog], 8 bytes ọtᵒtᵍhth [Try it online!][TIO-j4gqmgt8] [Brachylog]: https://github.com/JCumin/Brachylog [TIO-j4gqmgt8]: https://tio.run/##SypKTM6ozMlPN/r//@Hu3pKHWycBcW9GScb//4aWJhbmhgYmlhb/owA "Brachylog – Try It Online" ### Explanation Example input: 495902 ọ Occurences: [[4,1],[9,2],[5,1],[0,1],[2,1]] tᵒ Order by tail: [[0,1],[2,1],[4,1],[5,1],[9,2]] tᵍ Group by tail: [[[0,1],[2,1],[4,1],[5,1]],[[9,2]]] h Head: [[0,1],[2,1],[4,1],[5,1]] t Tail: [5,1] h Head: 5