Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Only the frequency of each character matters in finding the final answer.
If a character occurs less than 3 times, we cannot perform any process with it.
Suppose there is a character that occurs at least 3 times in the string, we can repeatedly delete two of these characters until there are at most 2 occurrences left of it.