Javascript one-line
\n/**\n * @param {number} x\n * @param {number} y\n * @param {number[][]} points\n * @return {number}\n */\nvar nearestValidPoint = function(x, y, points) {\n  
```\n/**\n * @param {number} x\n * @param {number} y\n * @param {number[][]} points\n * @return {number}\n */\nvar nearestValidPoint = function(x, y, points) {\n    return points.findIndex(p => p === points.filter(p => p[0] === x || p[1] === y)\n                            .sort((a,b) => -Math.abs(b[1]-y + b[0]-x) + Math.abs(a[1]-y + a[0]-x))[0])\n};\n```
['JavaScript']