Easy and Understandable code || accepted✅✅
Intuition\n Describe your first thoughts on how to solve this problem. \nNeed to count the occurence of \'L\' , \'R\' and \'\'\n\n# Approach\n Describe your app
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nNeed to count the occurence of \'L\' , \'R\' and \'_\'\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n1) Count the occurence \n2) Create ans in which add the count of \'_\'\n3) Subtract the count of minimum of \'L\' and \'R\'\n4) Add the count of maximum of \'L\' and \'R\'\n5) Return you answer\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n$$O(n)$$\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n$$(1)$$\n# Code\n```\nclass Solution {\npublic:\n    int furthestDistanceFromOrigin(string moves) {\n        int countL = 0;\n        int countR = 0;\n        int count_ = 0;\n        \n        int n = moves.size();\n        for(int i=0;i<n;i++){\n            if(moves[i] ==\'L\'){\n                countL++;\n            }\n            else if(moves[i] == \'R\'){\n                countR++;\n            }\n            else{\n                count_++;\n            }\n        }\n        int ans = max(countL,countR) - min(countL,countR) + count_;\n        return ans;\n        \n    }\n};\n```
['C++']