Start learning free

LESSON 165 OF 349 · LOOPS - CHALLENGES

Get Full Names II in Swift

Practice

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

    Get Full Names 2 in Swift

    Keep going with SwiftAbout 340 step-by-step lessons, from your first line of code to coding interviews. Free to start.
    Start learning free