[Python] Easy solution
\nclass Solution:\n    def nearestValidPoint(self, x: int, y: int, points: List[List[int]]) -> int:\n        minDist = math.inf\n        ans = -1\n        for i
```\nclass Solution:\n    def nearestValidPoint(self, x: int, y: int, points: List[List[int]]) -> int:\n        minDist = math.inf\n        ans = -1\n        for i in range(len(points)):\n            if points[i][0]==x or points[i][1]==y:\n                manDist = abs(points[i][0]-x)+abs(points[i][1]-y)\n                if manDist<minDist:\n                    ans = i\n                    minDist = manDist\n        return ans\n        \n```
['Python', 'Python3']