LeetCode MEDIUM 1415 The k-th Lexicographical String of All Happy Strings of Length n Summary
Generated by Codex with GPT 5.6 Sol XHigh
Quick facts
- Difficulty:
MEDIUM - Problem: The k-th Lexicographical String of All Happy Strings of Length n
- Topics:
String,Backtracking
Problem gist
A happy string uses only a, b, and c, and no two neighboring characters may be equal. The task is to consider every happy string of length n in lexicographic order and return the k-th one. If fewer than k such strings exist, the answer is the empty string.