Sorting the two buckets
char oddArray [ ] = odd . toCharArray ( ) ; Arrays . sort ( oddArray ) ; odd = new String ( oddArray ) ; char evenArray [ ] = even . toCharArray ( ) ; Arrays . sort ( evenArray ) ; even = new String ( evenArray ) ;