
[LeetCode] 1415. The k-th Lexicographical String of All Happy Strings of Length n (Python)
·
알고리즘/LeetCode
난이도: Medium문제 설명A happy string is a string that:consists only of letters of the set ['a', 'b', 'c'].s[i] != s[i + 1] for all values of i from 1 to s.length - 1 (string is 1-indexed).For example, strings "abc", "ac", "b" and "abcbabcbcb" are all happy strings and strings "aa", "baa" and "ababbc" are not happy strings. Given two integers n and k, consider a list of all happy strings of length n so..