Available question text
Given a beautiful string s over the first k lowercase letters, find the lexicographically smallest string of the same length that is strictly greater than s and contains no palindromic substring of length ≥2 (i.e., forbids equal adjacent letters and patterns like a_b_a). This is essentially the "next lexicographic string under local no-palindrome constraints" problem, solvable by greedy increment with backtracking.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
Amazon
Leetcode 2663. Lexicographically Smallest Beautiful String
Reported Dec 6, 2024 · 1 source report
MID_LEVEL
Source snapshot: Nov 12, 2026
View source