Stores the count of unique characters for each index
Map < Integer , Set < Character > > counts = new HashMap < > ( ) ; for ( int i = 0 ; i < m ; i ++ ) { counts . put ( i , new HashSet < > ( ) ) ; } for ( int i = 0 ; i < n ; i ++ ) {