about | help | code help+videos | done | prefs |
Given a string with odd length, switch the position of the first, middle, and last character. Put the first character in the middle, and at the same time put the middle character at the end, and put the last character at the beginning. For instance if str = "hello" the result should be "oehll" changeFirstMiddleLast("a") → "a" changeFirstMiddleLast("abc") → "cab" changeFirstMiddleLast("a**b**c") → "c**a**b" ...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: 200
Copyright Nick Parlante 2017 - privacy