You are given an integer array nums of length n and a binary string s of the same length.
In one operation, you can select an index i such that s[i] is $'0'$, and s[i + 1] is $'1'$, and swap s[i] with s[i + 1].
You may apply this operation any number of times.
The total score is the sum of nums[i] for all indices i where s[i] is equal to $'1'$.
Return the maximum score achievable.
Constraints:
n == nums.length == s.length
n
nums[i]
s[i] is either $'0'$ or $'1'$
You are given an integer array nums of length n and a binary string s of the same length.
In one operation, you can select an index i such that s[i] is $'0'$, and s[i + 1] is $'1'$, and swap s[i] with s[i + 1].
You may apply this operation any number of times.
The total score is the sum of nums[i] for all indices i where s[i] is equal to $'1'$.
Return the maximum score achievable.
Constraints:
n == nums.length == s.length
n
nums[i]
s[i] is either $'0'$ or $'1'$