Java Solution  || Intuitive || Easy
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:O(N^2)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int[] executeInstructions(int n, int[] startPos, String s) {\n        \n        int []execute = new int [s.length()];\n\n        for(int i=0;i<s.length();i++){\n            int []nextBox = new int []{startPos[0],startPos[1]};\n            for(int j=i;j<s.length();j++){\n                nextBox = boxNumber(s.charAt(j),nextBox);\n                if(nextBox[0]<0|| nextBox[0] == n||nextBox[1]<0||nextBox[1]==n){\n                    break;\n                }\n                execute[i]++;\n            }\n        }\n        return execute;\n    }\n    private int []boxNumber(char letter, int []cbox){\n\n        if(letter == \'R\'){\n            cbox[1]++;\n        }\n        else if (letter == \'L\'){\n            cbox[1]--;\n        }\n        else if(letter == \'U\'){\n            cbox[0]--;\n        }\n        else{\n            cbox[0]++;\n        }\n        return cbox;\n    }\n}\n```
['Java']