Python Beginners | 85% Fast |
Upvote if it helped. Thanks\n\n\nclass Solution:\n    def nearestValidPoint(self, x: int, y: int, points: List[List[int]]) -> int:\n        min_dis= 10000 \n   
Upvote if it helped. Thanks\n\n```\nclass Solution:\n    def nearestValidPoint(self, x: int, y: int, points: List[List[int]]) -> int:\n        min_dis= 10000 \n        ind = -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 < min_dis :\n                    min_dis = mandist\n                    ind = i\n        return ind\n```
['Python']