Greedy Distance Maximization
You're standing on a number line, starting from the zero point. You've got a set of instructions represented by a string, telling you to move either left ('L'), right ('R'), or take a step (''). But here's the twist: the step symbol '' means you can choose whether to move left or right greedily.
Now, your challenge is to figure out how far you can go from the starting point after following all these moves as wisely as possible.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)