Count the number of strings in A [ ] which has the frequency of the smaller character less than the frequency of the smaller character of the String in B [ ]
int [ ] array = new int [ smallestFreq . size ( ) ] ; int k = 0 ; for ( Integer val : smallestFreq ) { array [ k ] = val ; k ++ ; } int ind = lower_bound ( array , 0 , smallestFreq . size ( ) , frequency ) ;