C++ solution | Intutive
\nclass Solution {\npublic:\n    vector<vector<int>> spiralMatrixIII(int rows, int cols, int rStart, int cStart) {\n        int result=rows*cols;\n        int l
```\nclass Solution {\npublic:\n    vector<vector<int>> spiralMatrixIII(int rows, int cols, int rStart, int cStart) {\n        int result=rows*cols;\n        int limit=1;\n        int dir[4][2]={{0,1},{1,0},{0,-1},{-1,0}};\n        int d=0;\n        vector<vector<int>>ans={{rStart,cStart}};\n        int no=1;\n        while(ans.size()!=result)\n        {\n            for(int i=0;i<limit;i++)\n            {\n                rStart+=dir[d][0];\n                cStart+=dir[d][1];\n                if(rStart>=0 && rStart<rows && cStart>=0 && cStart<cols)\n                {\n                    ans.push_back({rStart,cStart});\n                }\n            }\n                \n                \n                d=(d+1)%4;\n            if(no==2)\n            {\n                limit++;no=1;\n            }\n            else no++;\n                \n                \n                \n        }\n        return ans;\n        \n    }\n    \n};\n```
['C']