Calculate Efficiency Score
You are given an initial parentheses sequence represented by the string s, along with a Parentheses Perfection Kit containing different types of parentheses in the form of the string kitParentheses and their respective efficiency ratings in the efficiencyRatings array (both of size m). The EfficiencyScore of the original string s is initially 0. You can use any number of unused parentheses from the kit to create the final sequence, as long as the final sequence remains balanced.
The task is to determine the maximum possible EfficiencyScore that can be achieved for the resulting balanced sequence. Note: It is guaranteed that the sequence can be made balanced by adding zero or more parentheses from the kit.
1Example 1
TO-DO: Add explanation for the example here.
Constraints
Limits and guarantees your solution can rely on.
s and kitParentheses consist of opening and closing parentheses only