Trim spaces

Easy
0/40
4 upvotes
Asked in company
JUSPAY

Problem statement

Given an input string S that contains multiple words, you need to remove all the spaces present in the input string.

There can be multiple spaces present after any word.

Detailed explanation ( Input/output format, Notes, Images )
Input Format :
 String S
Output Format :
Updated string
Constraints :

1 <= Length of string S <= 10^6

Sample Input :
abc def g hi
Sample Output :
abcdefghi
Approaches (1)
Time Complexity
Space Complexity
Code Solution
(100% EXP penalty)
Trim spaces
Full screen
Console