Question: Google | SWE | Online Screening | 22-08-2020
3
Entering edit mode
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

ADD COMMENTlink 4.2 years ago Shubhendu Goel • 450

Login before adding your answer.

Similar Posts
Loading Similar Posts