Premium Only Content

1779 Find Nearest Point That Has the Same X or Y Coordinate
You are given two integers, x and y, which represent your current location on a Cartesian grid: (x, y). You are also given an array points where each points[i] = [ai, bi] represents that a point exists at (ai, bi). A point is valid if it shares the same x-coordinate or the same y-coordinate as your location.
Return the index (0-indexed) of the valid point with the smallest Manhattan distance from your current location. If there are multiple, return the valid point with the smallest index. If there are no valid points, return -1.
The Manhattan distance between two points (x1, y1) and (x2, y2) is abs(x1 - x2) + abs(y1 - y2).
##############
My other Leetcode solving videos (easy)
https://www.youtube.com/playlist?list=PLg9w7tItBlZt4oUpNyWU_0rOItlScu1_d
Leetcode solving videos (Medium):
https://www.youtube.com/playlist?list=PLg9w7tItBlZvMGxy-y1eXURPD6Ao6kkzA
Leetcode solving videos (Hard):
https://www.youtube.com/playlist?list=PLg9w7tItBlZt4JQmlkGD3M5idZn14NyL6
############
-
1:09:26
Glenn Greenwald
5 hours agoTrump's Shifting Immigration and H-1B Policies: With Journalist Lee Fang and Political Science Professor Ron Hira | SYSTEM UPDATE #515
130K23 -
LIVE
LFA TV
23 hours agoLFA TV ALL DAY STREAM - MONDAY 9/15/25
633 watching -
54:12
Donald Trump Jr.
4 hours agoCharlie's Vision. Our Future. | TRIGGERED Ep274
167K112 -
1:03:35
BonginoReport
5 hours agoKirk’s Alleged Killer Dating Hateful Transgender??? - Nightly Scroll w/ Hayley Caronia (Ep.134)
102K119 -
1:01:12
The Nick DiPaolo Show Channel
6 hours agoKirk Assassination Exposes Insane Left | The Nick Di Paolo Show #1793
78.9K20 -
1:48:38
The Mike Schwartz Show
5 hours agoTHE MIKE SCHWARTZ SHOW Evening Edition 09-15-2025
45.7K11 -
LIVE
LIVE WITH CHRIS'WORLD
6 hours agoLIVE WITH CHRIS'WORLD - They Just Created 1 Million Charlie Kirks
72 watching -
2:07:48
Quite Frankly
8 hours agoStaggering Evil, Official Stories & Open Lines | Rich Baris 9/15/25
31.7K8 -
1:09:33
TheCrucible
6 hours agoThe Extravaganza! EP: 36 (9/15/25)
173K21 -
1:13:06
Candace Show Podcast
5 hours agoThey Are Lying About Charlie Kirk. | Candace Ep 235
121K554