Start learning free

LESSON 206 OF 667 · LOOPS - CHALLENGES

Get Full Names II

Practice

Given a vector of strings names that contain first and last names adjacent to each other, return a vector containing the full names (separated by one space)

Example:

Input:  names = ["John", "Doe", "Andy", "Smith", "Mary", "Johnson"]

Output:  ["John Doe", "Andy Smith", "Mary Johnson"]
STEP 1 OF 5
    Ctrl + Enter to check