Problem
A string is happy if it only uses the letters a, b and c, and never contains "aaa", "bbb" or "ccc" (no letter three times in a row).
Given three numbers a, b and c, build the longest possible happy string that uses at most a copies of 'a', b copies of 'b' and c copies of 'c'. If several longest strings exist, return any of them. If none can be built, return "".
Example 1
- Input
- a = 1, b = 1, c = 7
- Output
- "ccaccbcc"
- Why
- length 8; "ccbccacc" is also fine
Example 2
- Input
- a = 7, b = 1, c = 0
- Output
- "aabaa"
- Why
- length 5: only one b to split the a's
Constraints
0 <= a, b, c <= 100a + b + c > 0