You are given three integers x, y, and z.
You have:
x strings equal to "AA"
y strings equal to "BB"
z strings equal to "AB"
You want to concatenate a subset of these strings to create the longest possible string such that it does not contain "AAA" or "BBB" as a substring.
Return the maximum possible length of the resulting string.
Constraints:
x, y, z
You are given three integers x, y, and z.
You have:
x strings equal to "AA"
y strings equal to "BB"
z strings equal to "AB"
You want to concatenate a subset of these strings to create the longest possible string such that it does not contain "AAA" or "BBB" as a substring.
Return the maximum possible length of the resulting string.
Constraints:
x, y, z