Question: A string s is called GOOD if it satisfies the following conditions: s only contains the letters ' a ' , ' b ' ,
A string s is called GOOD if it satisfies the following conditions:
s only contains the letters ab and c
s does not contain any of "aaa", bbb or ccc as a substring.
s contains at most a occurrences of the letter a
s contains at most b occurrences of the letter b
s contains at most c occurrences of the letter c
Given three integers a b and c return the longest possible GOOD string. If there are multiple longest happy strings, return any of them. If there is no such string, return the empty string
A substring is a contiguous sequence of characters within a string in java
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
