about | help | code help+videos | done | prefs |
Write a method that returns a string in reverse order. There is a slight "catch" however. If the string has an odd number of characters, omit the middle character from the reversed string. If there are an even number of characters, simply return the reversed string in its entirety. The only string methods you are allowed to use are .length, .equals, .substring, and .charAt. Of course you do not need to use ALL of these methods. Recursion is optional. rrr1reverseString("") → "" rrr1reverseString("bogus") → "suob" rrr1reverseString("Ebbert") → "trebbE" ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 290
Copyright Nick Parlante 2017 - privacy