Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String decompress(String compressedText)
- {
- char c = compressedText.charAt(0);
- if(compressedText.length() == 1)
- {
- return compressedText;
- }
- else
- {
- if(Character.isLetter(c) == true)
- {
- return c + decompress(compressedText.substring(1));
- }
- else
- {
- compressedText = c-1 + compressedText.substring(1);
- return compressedText.substring(1, 2) + decompress(compressedText);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement