• Skip to primary navigation
  • Skip to content
  • Skip to footer
Xuanken's Space Xuanken's Space
  • About
  • Blog
  • Coding Exercises
  • Projects
    1. Home
    2. /
    3. Exercises
    4. /
    5. N Lexicographic Integers
    Xuanken Tay

    Xuanken Tay

    Software engineer who likes statistics, machine learning, DevOps and the cloud

    • Sydney, AU
    • GitHub
    • LinkedIn
    • Email

    N Lexicographic Integers

    March 13, 2022 less than 1 minute read

    Given an integer n, return first n integers sorted in lexicographic order.

    https://binarysearch.com/problems/N-Lexicographic-Integers

    Examples

    Example 1

    Input

    • n = 12

    Output

    • answer = [1, 10, 11, 12, 2, 3, 4, 5, 6, 7, 8, 9]

    Solution

    Categories: exercises

    Updated: March 13, 2022

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    Leave a comment

    Read more

    Hashicorp Certified: Vault Associate 002

    August 11, 2024 5 minute read

    How to prepare for the Vault Associate 002 exam.

    Helm: Migrate Releases from Helm 2 to Helm 3

    August 8, 2024 4 minute read

    How to migrate Helm 2 releases to Helm 3

    Kubernetes: Deployments

    May 11, 2024 2 minute read

    Ensuring reliable and up-to-date application deployment

    Anagram Substrings

    October 13, 2022 less than 1 minute read

    Given two strings s0 and s1, return the number of substrings where s1 contains any anagram of s0.

    • Follow:
    • GitHub
    • LinkedIn
    • Feed
    © 2024 Xuanken Tay. Powered by Jekyll & Minimal Mistakes.