Arrays to store the last occuring index of every character in the string
int [ ] small = new int [ 26 ] ; int [ ] capital = new int [ 26 ] ; int [ ] num = new int [ 10 ] ; for ( int i = 0 ; i < 26 ; i ++ ) { small [ i ] = 0 ; capital [ i ] = 0 ; } for ( int i = 0 ; i < 10 ; i ++ ) { num [ i ] = 0 ; }