1405. Longest Happy String
https://leetcode.com/problems/longest-happy-string
Description
A string is called happy if it does not have any of the strings 'aaa'
, 'bbb'
or 'ccc'
as a substring.
Given three integers a
, b
and c
, return any string s
, which satisfies following conditions:
s
is happyand longest possible.s
contains at mosta
occurrences of the letter'a'
, at mostb
occurrences of the letter'b'
and at mostc
occurrences of the letter'c'
.s
will only contain'a'
,'b'
and'c'
letters.
If there is no such string s
return the empty string ""
.
Example 1:
Example 2:
Example 3:
Constraints:
0 <= a, b, c <= 100
a + b + c > 0
ac
Previous1404. Number of Steps to Reduce a Number in Binary Representation to OneNext1406. Stone Game III
Last updated