We are given the results of a tennis match between two players A and B as a string. ↵
↵
↵
For eg- "ababbabaa", Here `If the ith character is 'a'` then it represents that the `ith game is won by Player A`.↵
↵
↵
A set is a `positive integer`.↵
A set is won by a player if he↵
The Player who is first to wins (set value) games firs e.g 1,2,3,4... ) games will win the set. ↵
↵
We have to find out `all valid sets that are possible for the string` and output the outcome of the match (The one who wins more sets wins the match).↵
↵
For eg If Set size = `3` , `ababb | abaa` , Resuts in a draw. ↵
↵
↵
If Set size = `2` , `aba | bb | aba | a` , Which is not a valid Match so set = 2 is not possible.↵
↵
If Set Size = `6` `|ababbabaa|` , Won by Player A↵
↵
↵
↵
For eg- "ababbabaa", Here `If the ith character is 'a'` then it represents that the `ith game is won by Player A`.↵
↵
↵
A set is a `positive integer`.↵
The Player who is first to win
↵
We have to find out `all valid sets that are possible for the string` and output the outcome of the match (The one who wins more sets wins the match).↵
↵
For eg If Set size = `3` , `ababb | abaa` , Resuts in a draw. ↵
↵
↵
If Set size = `2` , `aba | bb | aba | a` , Which is not a valid Match so set = 2 is not possible.↵
↵
If Set Size = `6` `|ababbabaa|` , Won by Player A↵
↵