You are given a string moves of length n consisting of the characters 'L', 'R', and '_'. The string represents your movement on a number line starting from the origin
In each step:
If the character is 'L', you move
If the character is 'R', you move
If the character is '_', you may choose to move
Return the maximum distance from the origin you can reach after completing all n moves.
Constraints:
moves.length
moves consists only of the characters 'L', 'R', and '_'.
You are given a string moves of length n consisting of the characters 'L', 'R', and '_'. The string represents your movement on a number line starting from the origin
In each step:
If the character is 'L', you move
If the character is 'R', you move
If the character is '_', you may choose to move
Return the maximum distance from the origin you can reach after completing all n moves.
Constraints:
moves.length
moves consists only of the characters 'L', 'R', and '_'.