HackerRank - Count the number of elements 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 count of elements in that array.

# Input

# Output

# Solution

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

Post: