MINIMUM REPLACEMENTS TO CONVERT A BIT STRING HAVINGEQUAL 10 AND 01
STRING="101011"
QUERY 1: SUBSTRING SPAN=(1,5)
SUBSTRING=10101
ANSWER: 0
QUERY 2: SUBSTRING SPAN:(4,5)
SUBSTRING =01
ANSWER: 1
QUERY 3: SUBSTRING SPAN(5,6)
SUBSTRING=11
ANSWER=?
The solution to finding the minimum replacements is using Dictionary.
how to count for strings such as "111"