Algorithm
Furthest Point From Origin
Solution
class Solution:
def furthestDistanceFromOrigin(self, moves: str) -> int:
L = moves.count('L')
R = moves.count('R')
B = moves.count('_')
return abs(L - R) + BVideo GuideLeetcode Daily
Time Complexity
O(n)
Space Complexity
O(1)
