about | help | code help+videos | done | prefs |
Write a method that swaps pairs of letters from the input parameter string. As a precondition, you may assume that the input parameter string contains an even number of characters. So "this" is a possible input parameter string, but "not" is not a possible input parameter string because it has an odd number of characters. Here is an example: Passing in "abcd" produces a result of "badc" because the a and b are swapped, then the c and d are swapped. nov3_2017_APSLHL_swapPairs("") → "" nov3_2017_APSLHL_swapPairs("gg") → "gg" nov3_2017_APSLHL_swapPairs("aardvark") → "aadravkr" ...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: 280
Copyright Nick Parlante 2017 - privacy