Marks :100
: 4 | : 0
Given a string with only characters X and Y. Find the minimum number of characters to remove from the string such that there is no interleaving of characters X and Y and all the Xs appear before any Y.
The first and online line of input contains a string S ($$$1 le S \le 1e5$$$)
For each test case print, the minimum number of characters to remove
YXXXYXY
2
YYXYXX
3
For the first test case :
We can obtain XXXYY by:
Delete the first Y—XXXYXY
Delete the last occurrence of X –XXXYY
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.