Find index of characters of a that are also present in string b
HashMap < Character , ArrayList < Integer > > CharacterIndex = new HashMap < > ( ) ; for ( int i = 0 ; i < a . length ( ) ; i ++ ) { char x = a . charAt ( i ) ;