C++ Easy Solution || 0ms || Intuitive Approach
class Solution {\npublic:\n    \n    bool Valid(int i,int j,int n,int m){\n        if(i<0 || j<0 || j>=m || i>=n) return false;\n        return true;\n    }\n  
class Solution {\npublic:\n    \n    bool Valid(int i,int j,int n,int m){\n        if(i<0 || j<0 || j>=m || i>=n) return false;\n        return true;\n    }\n    vector<vector<int>> spiralMatrixIII(int n, int m, int x, int y) {\n        vector<vector<int>> ans ;\n        ans.push_back({x,y});   //initial point\n        int len=1;\n        while(ans.size()<n*m){              //Base Case --> once we get whole grid --> break\n            for(int j=1;j<=len;j++){        //going right \n                if(Valid(x,y+j,n,m)){       //Checking if this pos exists in Grid\n                    ans.push_back({x,y+j});\n                }\n            }\n            y+=len;                         //Updating the value of y coordinate \n            for(int i=1;i<=len;i++){        //Going Down\n                if(Valid(x+i,y,n,m)) ans.push_back({x+i,y});        //Checking if exists in Grid\n            }\n            x+=len;                         //Updating X coordinate \n            len++;          //Increasing length of step in each direction \n            for(int j=1;j<=len;j++){        //Going Left \n                if(Valid(x,y-j,n,m)) ans.push_back({x,y-j});\n            }\n            y-=len;\n            for(int i=1;i<=len;i++){        //Going Up\n                if(Valid(x-i,y,n,m)) ans.push_back({x-i,y});\n            }\n            x-=len;\n            len++;\n        }\n        return ans;\n    }\n};
[]