Function to prlet the desired lexicographic smaller String
function findSmallestString ( str1 , str2 ) { let freq1 = Array . from ( { length : 26 } , ( _ , i ) => 0 ) ; let freq2 = Array . from ( { length : 26 } , ( _ , i ) => 0 ) ;