wes d2a2ba9e15 first commit | %!s(int64=4) %!d(string=hai) anos | |
---|---|---|
.. | ||
README.md | %!s(int64=4) %!d(string=hai) anos | |
code.cpp | %!s(int64=4) %!d(string=hai) anos | |
unitTest.cpp | %!s(int64=4) %!d(string=hai) anos |
by Alex Golubov tags: strings, sorting
Create a function that accepts a string (of a persons first and last name) and returns a string with the first and last name swapped. Examples nameShuffle("Donald Trump") ➞ "Trump Donald" nameShuffle("Rosie O'Donnell") ➞ "O'Donnell Rosie" nameShuffle("Seymour Butts") ➞ "Butts Seymour" Notes There will be exactly one space between the first and last name. I
Create a function that accepts a string (of a persons first and last name) and returns a string with the first and last name swapped.
nameShuffle("Donald Trump") ➞ "Trump Donald"
nameShuffle("Rosie O'Donnell") ➞ "O'Donnell Rosie"
nameShuffle("Seymour Butts") ➞ "Butts Seymour"