Easy approach || Constant space || Beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \n Note: This question doesn\'t require the Left and Right in one sequence. It can be cou
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n* Note: This question doesn\'t require the Left and Right in one sequence. It can be counted without being in same sequence.\n* This makes the question a lot easier.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n* We can keep 3 pointers: leftCount, rightCount, and blankCount.\n* Once we traverse through the loop, we will get all the occurances stored.\n* By subtracting L to R or R to L, we can nullify the occurances. If a point is moving to L as well as R, then in the end it will not change its position.\n* To figure out L is greater or R, use **Math.abs**\n* It will convert the negative number into positive while figuring out the difference, and then we can add the blankCount into it.\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(N)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n# Code\n```\nclass Solution {\n    public int furthestDistanceFromOrigin(String moves) {\n        int leftC = 0;\n        int rightC = 0;\n        int blankC = 0;\n\n        for (int i = 0; i < moves.toCharArray().length; i++) {\n            if (moves.charAt(i) == \'L\') leftC++;\n            else if (moves.charAt(i) == \'R\') rightC++;\n            else blankC++;\n        }\n\n        return Math.abs(leftC - rightC) + blankC;\n    }\n}\n```
['String', 'C++', 'Java']