2 posts about Lexicographically Smallest String by 1 contributor.
Know Lexicographically Smallest String? Share what you know with developers who are learning it.
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.
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.
DevSocialUpcoming · 3rd editionAI Agents ConferenceNov 23–27, 2026Live onlineMembers only16days leftRegisterPublish an article in this category and earn +1,000 SHARP when it is approved.
Write an article