Skip to content

Lexicographically Smallest String

2 posts1 contributor

+ FollowBe the first to follow this
Write about it

Articles about Lexicographically Smallest String

  1. Secret Cipher – O(n) Java Solution Using KMP

    Learn how to solve the Secret Cipher problem efficiently using the KMP (Knuth-Morris-Pratt) prefix function / LPS array in Java. This article explains how repeated prefixes can be identified and compressed using *, how the algorithm constructs the lexicographically smallest encrypted string, and how to achieve O(n) time complexity for strings up to 105 characters.

    Sandhiya PriyaSandhiya Priya2,5441,000
  2. Lexicographically Smallest String After Removing K Characters Using a Monotonic Stack

    Learn how to find the lexicographically smallest string after removing K characters using a monotonic stack in Java. Includes explanation, dry run, and optimized O(n) solution.

    Sandhiya PriyaSandhiya Priya2,8821,000