Question: Google | SWE | Online Screening | 22-08-2020 For a string of lowercase alphabets you are allowed to perform 2 types of operations.
1. Remove the substring "pr" and gain X points.
2. Remove the substring "rp" and gain Y points.
Find the maximum points that you can gain.
Example
abcdpabcpprrrprp , X=4 , Y=5
Output :: 18
Login before adding your answer.