You are given a binary string s and two integers num1 and num2.
A substring of s is considered valid if the ratio of the number of $0$s to the number of $1$s in the substring is equal to num1 to num2.
Return the total number of non empty valid substrings of s.
Constraints:
s.length
num1, num2 s.length
num1 and num2 are coprime integers.
You are given a binary string s and two integers num1 and num2.
A substring of s is considered valid if the ratio of the number of $0$s to the number of $1$s in the substring is equal to num1 to num2.
Return the total number of non empty valid substrings of s.
Constraints:
s.length
num1, num2 s.length
num1 and num2 are coprime integers.