C++ || Easy || faster than 96% || single loop
\nvector<vector<int>>out(r,vector<int>(c,0));\n        int n=mat.size();//row size\n        int  m=mat[0].size();//column size\n        if((n*m)==(r*c))\n      
```\nvector<vector<int>>out(r,vector<int>(c,0));\n        int n=mat.size();//row size\n        int  m=mat[0].size();//column size\n        if((n*m)==(r*c))\n        {\n            for(int i=0;i<(r*c);i++)\n            {\n                out[i/c][i%c]=mat[i/m][i%m];//simple evaluation of matrix\n            }\n            return out;\n        }\n        else\n            return mat;\n```\n\nIf you find any issue in understanding the solutions then comment below, will try to help you.\nIf you found my solution useful.\nSo please do upvote and encourage me to document all leetcode problems\uD83D\uDE03\nHappy Coding :)
['C']