Simple python solution
```\nclass Solution:\n    def nearestValidPoint(self, x: int, y: int, points: List[List[int]]) -> int:\n        # answer array to insrt the index\n        answe
```\nclass Solution:\n    def nearestValidPoint(self, x: int, y: int, points: List[List[int]]) -> int:\n        # answer array to insrt the index\n        answer = -1\n        # starting point for distance to compare\n        man_distance = float("inf")\n        \n        # allows east insert to answer arrow and increment\n        count = 0 \n        \n        # loop through point\n        for point in points:\n            if point[0] == x or point[1] == y:\n                # compare \n                current_man_distance = abs(point[0] - x) + abs(point[1] - y)\n                if current_man_distance < man_distance:\n                    # update the man_distance\n                    man_distance = current_man_distance\n                    answer = count\n            \n            # increment count\n            count = count + 1\n        \n        return answer\n\t\t
['Python']