LeetCode 440: K-th Smallest in Lexicographical Order
Problem Restatement We are given two integers n and k . We need to return the k -th smallest integer in lexicographical order among all integers from 1 to n . Lexicographical order means dictionary order, as if every number were compared as a string. For example, when: n = 13 the numbers in lexicographical order are: [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9]...