We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Apply
  • Hiring developers?
  1. Prepare
  2. Linux Shell
  3. Text Processing
  4. 'Tr' Command #3

'Tr' Command #3

Problem
Submissions
Leaderboard
Discussions
Editorial
Tutorial

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

Author

PRASHANTB1984

Difficulty

Easy

Max Score

1

Submitted By

29181

Need Help?


View tutorial
View discussions
View editorial
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy