A simple approach
IntuitionFind the count of characters 'L', 'R' and '_'.Approa
Convert the string to character array.
Loop through each character and maintaing the count of in i
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
Find the count of characters 'L', 'R' and '_'.

# Approa
<!-- Describe your approach to solving the problem. -->
1. Convert the string to character array.
2. Loop through each character and maintaing the count of in its respective variables. `lCount`, `rCount` and `dashCount`.
3. Finally return the addition of the dashCount with the abs value from lCount and rCount.

# Complexity
- Time complexity: $$O(n)$$
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: $$O(1)$$
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int furthestDistanceFromOrigin(String moves) {
        int lCount = 0; int rCount = 0; int dashCount = 0;
        for(char ch : moves.toCharArray()){
            if(ch == 'L'){
                lCount++;
            }

            if(ch == 'R'){
                rCount++;
            }

            if(ch == '_'){
                dashCount++;
            }
        }
        return dashCount + Math.abs(lCount-rCount);
    }
}
```
['String', 'Counting', 'Java']