NeetCode #501LC-1415MediumBacktracking
← Back to All Problems#501 · #1415 · The k-th Lexicographical String of All Happy Strings of Length n(长度为 n 的开心字符串中字典序第 k 小的字符串)
📌 Problem Statement & Constraints
A happy string consists only of
a, b, c and has no two adjacent characters equal. Given n and k, return the k-th lexicographically smallest happy string of length n, or the empty string if fewer than k exist. Constraints: 1 <= n <= 10, 1 <= k <= 100.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!