Maximize Score

Problem Overview

  • Maximize total score by repeatedly removing substrings of identical characters from S; each removal adds the size-th element of arr, where size is the substring length; continue until S is empty and return the maximum score.
  • Inputs: string S and integer array arr; Output: an integer maximum score; constraints not specified.
  • Domain: string manipulation and scoring optimization in a game-like setting.
  • From Cvent interviews; a classic coding interview interview question problem.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: