Lexicographical Order Leetcode