LeetCode 386: Lexicographical Numbers
Problem Restatement We are given an integer n . We need to return all numbers from 1 to n in lexicographical order. Lexicographical order means dictionary order, as if the numbers were strings. For example, when n = 13 , the numbers are ordered like this: [1, 10, 11, 12, 13, 2, 3, 4, 5, 6, 7, 8, 9] The problem asks for an algorithm that runs in O(n) time...