method returns total number of substring having K ones
< ? php function countOfSubstringWithKOnes ( $ s , $ K ) { $ N = strlen ( $ s ) ; $ res = 0 ; $ countOfOne = 0 ; $ freq = array ( ) ; for ( $ i = 0 ; $ i <= $ N ; $ i ++ ) $ freq [ $ i ] = 0 ;