about | help | code help+videos | done | prefs |
Write a method that returns the input parameter string with the even positioned characters in the same place (with the first character in position zero, which is even), and the odd positioned characters in reverse order. For example, the input string "AbCdEfG" becomes "AfCdEbG". In this case, I used capital letters at each of the even positions and lower-case letters at each of the odd positions to make it clearer. Note that the even positioned letters are in the original order and in the original position, but the odd positioned letters are in revers order. Look at the test data for further examples. mar7_2016_APSLHL_partialReverse("this_is_a_test") → "ttie__s_aitssh" mar7_2016_APSLHL_partialReverse("") → "" mar7_2016_APSLHL_partialReverse("make_this_program_awesome") → "mmks_wh_sapgorr_miateeoae" ...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: 330
Copyright Nick Parlante 2017 - privacy