C++ || Easy brute force soln beats 96% soln by time
\nvector<int> executeInstructions(int n, vector<int>& startPos, string s) {\n        // Create a vector of m size and initialise to 0 \n        int m = s.size()
```\nvector<int> executeInstructions(int n, vector<int>& startPos, string s) {\n        // Create a vector of m size and initialise to 0 \n        int m = s.size();\n        vector<int> v(m,0);\n\t\t// Iterate over the vector\n        for(int i=0;i<m;i++){\n            int ans = 0; int x = startPos[0], y = startPos[1];\n\t\t\t// Check for the string operations if they are valid\n            for(int j=i;j<m;j++){\n                if(s[j]==\'R\') y++;\n                else if(s[j]==\'L\') y--;\n                else if(s[j]==\'U\') x--;\n                else x++;\n\t\t\t\t// Check whether if it stays in the grid then increase the count\n                if(x>=0 && x<n && y>=0 && y<n) ans++;\n                else break;\n            }\n\t\t\t// Update the value at the required index \n            v[i] = ans;\n        }\n        return v;\n    }\n```
['C']