text: Update lexicographically smallest substring if the current count is equal to the maximum count
code: else if ( currCount == maxCount ) { string temp = str . substr ( i - K + 1 , K ) ; if ( temp < res ) res = temp ; } }