Start learning free

LESSON 211 OF 677 · LOOPS - CHALLENGES

Get Full Names II

Practice

Given an array of strings names that contain first and last names adjacent to each other, return a list 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