An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
March 17, 2020 02:17 pm GMT
Original Link: https://dev.to/thepracticaldev/daily-challenge-206-pound-means-backspace-4a53
Daily Challenge 206 - Pound Means Backspace
Assume "#" is like a backspace in string. This means that string "a#bc#d" would actually be "bd".
Implement a function that will process a string with "#" symbols and understand them as backspaces.
Examples
"abc#def##ghi###"
==> "abd"
"abc#d##c"
==> "ac"
"abc##d######"
==> ""
"#######"
==> ""
""
==> ""
Tests
cleanString('abc#de##c')
cleanString('abc####dhh##c#')
cleanString('Thee# Empires# SS#tateBuildingg#')
Good Luck!
This challenge comes from vetalpaprotsky on CodeWars. Thank you to CodeWars, who has licensed redistribution of this challenge under the 2-Clause BSD License!
Want to propose a challenge idea for a future post? Email [email protected] with your suggestions!
Original Link: https://dev.to/thepracticaldev/daily-challenge-206-pound-means-backspace-4a53
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To