Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 17, 2020 02:17 pm GMT

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:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To