Any idea on how to solve the below question?
Given a binary string s of 1 and 0. Return an array that answers the queries defined as below.
if q is ? then count the number of 1 in the string
if q is - then decrement the decimal representation of binary string by 1
Sample Example:
Input:
s = "101"
queries = ["?", "-", "?"]
Output
ans: [2, 1]
1 <= q.size() <= 100000
1 <= len(s) <= 100000