[LeetCode] 1415. The k-th Lexicographical String of All Happy Strings of Length n (JavaScript)


[LeetCode] 1415. The k-th Lexicographical String of All Happy Strings of Length n (JavaScript)

https://leetcode.com/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/ Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com a, b, c의 알파벳만 사용해서 문자를 만들 때, 연속되는 알파벳이 없는 문자열을 happy string이라고 한단다. n자리수까지 가능한 알파벳들을 구한 뒤, 그 알파벳들 중 k번째 문자열을 리턴하는 문제였다. 백트래킹을 이용하여 문제를 풀 수 있었다. 동일 문자열이 들어가지 않게 막고, k번째 문자열까지만 구할 수 있도록 하여 풀 수 있었다. /** * @param {number} n * @param {number} k * @return...


#leetcodeThekthLexicographicalStringofAllHappyStringsofLengthn #ThekthLexicographicalStringofAllHappyStringsofLengthn #ThekthLexicographicalStringofAllHappyStringsofLengthnjavascript #ThekthLexicographicalStringofAllHappyStringsofLengthnjs

원문링크 : [LeetCode] 1415. The k-th Lexicographical String of All Happy Strings of Length n (JavaScript)