about | help | code help+videos | done | prefs |
Given a string containing two words separated by a comma, return a new string with the two words swapped. Each word will contain at least one letter. Note: A good first step would be to determine the location of the comma. Once you know its location, you can use it to grab the substrings on the left and right sides of that comma. swapWords("cat,dog") → "dog,cat" swapWords("house,boat") → "boat,house" swapWords("a,bc") → "bc,a" ...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: 150
Copyright Nick Parlante 2017 - privacy