HackerRank - 'Tr' Command #3

April - 25/2025

Problem:

In a given fragment of text, replace all sequences of multiple spaces with just one space.

# Input

# Output

# Solution

            
    tr -s ' '
    

# Solution_01

            
    tr -s [:space:]
    

# Solution_02

            
    while read line
    do 
        echo "$line" | tr -s ' '
    done
    

Post: