98% FASTER || BRUTE-FORCE || C++ || EASY UNDERSTAND
\nclass Solution {\npublic:\n    vector<int> executeInstructions(int n, vector<int>& v, string s) {\n        int b = (s.length()),x,y,z,j;\n        vector<int> 
```\nclass Solution {\npublic:\n    vector<int> executeInstructions(int n, vector<int>& v, string s) {\n        int b = (s.length()),x,y,z,j;\n        vector<int> ans(b);\n        for(int i = 0; i < b; i++){\n            x = v[0],y = v[1],z=0;\n            for(j = i; j<b; j++){\n                if(s[j]==\'L\'){\n                    y--;\n                }else if(s[j]==\'R\'){\n                    y++;\n                }else if(s[j]==\'U\'){\n                    x--;\n                }else{\n                    x++;\n                }\n                if(x<0||y<0||x>=n||y>=n)break;\n                z++;\n            }\n            ans[i] = z;\n        }\n        return ans;\n    }\n};\n```
['Depth-First Search', 'C', 'C++']