Hello Programmers, In this post, you will know how to solve the ‘Tr’ Command #3 HackerRank Solution. This problem is a part of the HackerRank Linux Shell Series.
One more thing to add, don’t directly look for the solutions, first try to solve the problems of Hackerrank by yourself. If you find any difficulty after trying several times, then you can look for solutions.
Problem
In a given fragment of text, replace all sequences of multiple spaces with just one space.
Input Format
A block of ASCII text.
Output Format
Replace all sequences of multiple spaces with just one space.
Sample Input
He llo
Wor ld
how are you
Sample Output
He llo
Wor ld
how are you
‘Tr’ Command #3 HackerRank Solutions
#Replace all sequences of multiple spaces with just one space. tr -s ' '
Note: This problem (‘Tr’ Command #3) is generated by HackerRank but the Solution is Provided by BrokenProgrammers. This tutorial is only for Educational and Learning purposes.