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:53:34
Kim Iversen
6 hours agoEXPOSED: Pentagon’s Secret Anti-Vax Campaign | Establishment Starts To Finally Ask “Are We Baddies?”
56.2K128 -
1:53:49
Melonie Mac
5 hours agoGo Boom Live Ep 9!
19.9K5 -
1:22:22
Precision Rifle Network
13 hours agoGuns & Grub S2E9 - Rex Shoots A Match
16.9K -
1:25:41
Break The Cycle w/ Joshua Smith
4 hours agoBreak The Cycle Ep: 241 Trump isn't going to jail w/ Harrison Wells
22.6K1 -
1:55:59
Glenn Greenwald
7 hours agoAIPAC's Singular Ability to Remove and Influence Members of Congress; Senator Rand Paul On More COVID Cover-Ups; PLUS: Media Denies Biden's Decline | SYSTEM UPDATE #286
74.8K76 -
1:02:54
The StoneZONE with Roger Stone
5 hours agoThe Epic Corruption of JB Pritzker + Chaos at Democrat Convention in Chicago? The StoneZONE
31.8K8 -
1:29:03
Donald Trump Jr.
11 hours agoRight Wing Revolution: How to Win on the Ground, at the Ballot Box, and Save the West, Charlie Kirk & Sean Parnell | TRIGGERED Ep.147
115K209 -
1:42:49
The Quartering
10 hours agoDisney BUSTED On Secret Recording & Star Wars The Acolyte Backlash GOES NUCLEAR!
67K23 -
6:48
One Bite Pizza Reviews
1 day agoBarstool Pizza Review - Christo's Restaurant & Bar (Wallingford, CT)
45.8K25 -
28:25
Degenerate Plays
7 hours agoAll Bricked Up - Call Of Duty Modern Warfare Remastered : Part 9
33.1K18