furthestDistanceFromOrigin: easy O(n) solution. BEAT 100%. ✅
IntuitionFirst thoughts on solving this problem involve counting the movements to the right and left to determine the furthest distance from the origin.Approach
# Intuition
First thoughts on solving this problem involve counting the movements to the right and left to determine the furthest distance from the origin.

# Approach
The approach involves iterating through the moves string, counting the occurrences of 'R' and 'L'. The result is calculated by finding the difference between the counts of 'R' and 'L'.

# Complexity
- Time complexity:
O(n)

- Space complexity:
O(1)

# Code
```c []
int furthestDistanceFromOrigin(char* moves) {
    int cnt_R=0;
    int cnt_L=0;
    int i;
    for(i=0;moves[i]!='\0';i++){
        if(moves[i]=='R') cnt_R++;
        else if(moves[i]=='L') cnt_L++;
    }
    if(cnt_R==0 && cnt_L==0) return i;
    else if(cnt_R>=cnt_L) return i-2*cnt_L;
    else return i-2*cnt_R;
}
```
['String', 'C', 'Counting']