String
1717. Maximum Score From Removing Substrings
Remove "ab" for x points or "ba" for y points (any number of times, any order); maximise total points. The greedy: remove the more valuable pair first (clearing all of it), then the cheaper pair on…
Loading…