🟢 Simple C++ Solution || counting || Mr. Robot
Approach\nCount the L and R and replace the blanks with most frequent symbol\n\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n---\n\n# Code
# Approach\nCount the L and R and replace the blanks with most frequent symbol\n\n# Complexity\n- Time complexity: O(n)\n\n- Space complexity: O(1)\n---\n\n# Code\n```\nclass Solution {\npublic:\n    int furthestDistanceFromOrigin(string moves) {\n       int cntL = 0, cntR = 0,  cntB = 0;\n        for(auto i : moves){\n            if(i == \'L\')cntL++;\n            else if(i == \'R\')cntR++;\n            else if (i == \'_\')cntB++;\n        }\n        \n        int maxi = max(cntR,cntL);\n        if(maxi == cntL){\n            return abs(cntB + maxi - cntR);\n        }\n        return abs(cntB + maxi - cntL);\n    }\n};\n```\n---\nCONSIDER UPVOTING \u2B06\uFE0F\n\n\nDROP YOUR SUGGESTIONS IN THE COMMENT\n\nKeep Coding\uD83E\uDDD1\u200D\uD83D\uDCBB\n\n-- *MR.ROBOT SIGNING OFF*\n
['Counting', 'C++']