HackerRank - Read in an Array

April - 25/2025

Problem:

Given a list of countries, each on a new line, your task is to read them into an array and then display the entire array, with a space between each of the countries' names.

# Input

# Output

# Solution

            
    mapfile -t array
    echo "${array[@]}"
    

# Solution_01

            
    while read c ; do echo -n "$c "; done
    

Post: