1405. Longest Happy String

Practice Longest Happy String for free on NudgeCode: Medium, Heap pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.

A string is happy if:

Return the longest happy string. If several happy strings have that longest length, return any of them; the expected value is one of them. If only the empty string is happy, return "".

Example

a = 1, b = 1, c = 7  ->  "ccaccbcc"

"ccbccacc" is also accepted. No happy string for these counts is longer than 8.

Constraints