Equal row and column pair

PHOTO EMBED

Wed Aug 03 2022 06:39:13 GMT+0000 (Coordinated Universal Time)

Saved by @Ranjan_kumar #c++

class Solution {
public:
    int equalPairs(vector<vector<int>>& grid) {
        int c=0;
        int k=grid.size()-1;
        while(k>=0)
        {
       
            vector<int>vr;
            vr=grid[k];
            for(int i=0;i<grid.size();i++)
            {
                vector<int>vc;
                for(int j=0;j<grid.size();j++)
                {
                    vc.push_back(grid[j][i]);
                }
                if(vr==vc) c++;
            }
        
            k--;
        }
        return c;
    }
};
content_copyCOPY

https://leetcode.com/contest/weekly-contest-303/problems/equal-row-and-column-pairs/