use num > -num as the condition to correct the negative 0
Thanks for this, I had the same question.
How does this code remove the multiple spaces? I can only understand how it replaces the WUBs with a space each time, not how it accounts for the potential multiple spaces
Abbe, please use spoiler flag next time.
This comment is hidden because it contains spoiler information about the solution
i understand the math.min part but can someone explain why "...args"? why not just "args"
^ CORRECTIONS AND TO BE MORE SPECIFIC:
The + means to match whatever is infront of it 1 or more times**
Then you have the astric * (which is not included but important to differentiate from the plus) it matches whatever is infront of it from 0 or more times.
And finally g the global tells regex to not stop after the first match but continue and look for more matches
This was a great exercise to start to really dip my toes into regex and play around with some stuff. I am glad I got the same result here!
So elegant :D
spoiler flag, plz...
very clever :)