You are given an integer array nums and a binary string s, both of length n.
A token is initially located at index i if s[i] == '1'. For each token at index i, you may choose one of the following actions:
Keep the token at index i.
Shift the token to index
At most one token can occupy any index after all choices are made.
Return the maximum possible sum of nums[j] across all indices j covered by a token.
Constraints:
n nums.length s.length
nums[i]
s[i] is either '0' or '1'
You are given an integer array nums and a binary string s, both of length n.
A token is initially located at index i if s[i] == '1'. For each token at index i, you may choose one of the following actions:
Keep the token at index i.
Shift the token to index
At most one token can occupy any index after all choices are made.
Return the maximum possible sum of nums[j] across all indices j covered by a token.
Constraints:
n nums.length s.length
nums[i]
s[i] is either '0' or '1'