Available question text
Find the k-th lexicographically smallest length-n string over {a,b,c} with no two adjacent characters equal, or return empty if fewer than k exist. Use combinatorial counting (total = 3 * 2^{n-1}) to construct the answer character-by-character by skipping blocks of size 2^{remaining-1} rather than enumerating all strings.
Related questions
Continue with questions that share topics or the same question type.
- Asked LC medium problems. Problems were not difficult, even without preparation--all related to string manipulation or array manipulation.
Coding
- Check If a String Contains All Binary Codes of Size K
Coding
- Check If All 1's Are at Least Length K Places Away
Coding
- Check if an Original String Exists Given Two Encoded Strings
Coding
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
No company association
Leetcode 1415. The k-th Lexicographical String of All Happy Strings of Length n
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source