Include the current character in its upper case form To remove the last character , we generate a substring till the second last character
output = output . substring ( 0 , output . length ( ) - 1 ) ; output += String . valueOf ( Character . toUpperCase ( input . charAt ( index ) ) ) ; generateSubsequences ( input , output , index + 1 , ans ) ; }