C++ || Brute Force approach || Easy to Understand
\nclass Solution {\npublic:\n    int nearestValidPoint(int x, int y, vector<vector<int>>& points) {\n        int mi=INT_MAX,res=-1;\n        for(int i=0;i<point
```\nclass Solution {\npublic:\n    int nearestValidPoint(int x, int y, vector<vector<int>>& points) {\n        int mi=INT_MAX,res=-1;\n        for(int i=0;i<points.size();i++)\n        {\n            int x1=points[i][0],y1=points[i][1];\n            if(x==x1||y==y1) \n            {\n                int dis=abs(x1-x)+abs(y1-y);\n                if(mi>dis) \n                {\n                    mi=dis;\n                    res=i;\n                }\n            }\n        }\n        return res;\n    }\n};\n```\nIf you like it, please upvote..
['C']