Help me in solving XYSTRP4 problem

My issue

unable to understand the question

My code

14548,14549

Learning course: Greedy Algorithms
Problem Link: MCQ Practice Problem in Greedy Algorithms - CodeChef

@sandeepaketi

Correct Answer(s):

When the whole string is "xyxy".
When the whole string is "xyxyxy".
Explanation:
When the whole string is "xyxy", if you pick (Student 2, Student 3), you end up with only 1 pair. But we can actually pick 2 pairs.

When the whole string is "xyxyxy", if you pick (Student 2, Student 3), you end up with only 2 pairs. But we can actually pick 3 pairs.
Submit
1 Like

@dpcoder_007 thanks brother