Function performing calculations .
public static void solve ( ) { w = z . toCharArray ( ) ; letter = ' d ' ; int l = z . length ( ) ; int p = letter - ' a ' ; for ( int i = 0 ; i < 100 ; i ++ ) pre [ i ] = false ;