method returns total number of substring having K ones
static int countOfSubstringWithKOnes ( string s , int K ) { int N = s . Length ; int res = 0 ; int countOfOne = 0 ; int [ ] freq = new int [ N + 1 ] ;