【手撕leetcode|54. 螺旋矩阵】一般这种东西我不会贴,好2。我这个写的挺工整的我承认,但是超过了100%的用户?什么鬼?
class Solution {
public:void roundPrint(vector >&matrix, vector&print,int a, int b, int c, int d)
{
for(int i=b;
ib;
--i)
print.push_back(matrix[c][i]);
for(int i=c;
i>a;
--i)
print.push_back(matrix[i][b]);
}
vector spiralOrder(vector >&matrix)
{
vectorprint;
if(matrix.empty())
return print;
int a=0, b=0, c=matrix.size()-1, d=matrix[0].size()-1;
while(a