Function to count the number of substrings that contains more 1 s than 0 s
int getSubsCount ( string & input ) { int n = input . length ( ) ; vector < int > nums ( n ) ; for ( int i = 0 ; i < n ; i ++ ) { nums [ i ] = input [ i ] - '0' ; if ( nums [ i ] == 0 ) nums [ i ] = -1 ; }