Reverse String for A [ n - 1 ] to length
reverseStr ( A [ n - 1 ] , s . length ( ) ) ; } static String swap ( int i , int j ) { char ch [ ] = s . toCharArray ( ) ; char temp = ch [ i ] ; ch [ i ] = ch [ j ] ; ch [ j ] = temp ; return String . valueOf ( ch ) ; }