Search
⌘K

Leetcode 1405. Longest Happy String

Construct the longest possible string using up to a, b, and c occurrences of letters 'a', 'b', and 'c' such that it never contains "aaa", "bbb", or "ccc"; the core challenge is to schedule letters (favoring those with higher remaining counts) without creating three identical consecutive characters.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.