Question
PLEASE DO IN PYTHON. I WILL RATE. If two cities have the same distance to the queried city, consider the one with an alphabetically smaller
PLEASE DO IN PYTHON. I WILL RATE. If two cities have the same distance to the queried city, consider the one with an alphabetically smaller name ( ie 'ab' Given a list of points, find the nearest points that shares either an x or a y coordinate with the queried point. The distance is denoted on a Euclidean plane: the difference in x plus the difference in y. Input numOfPoints, an integer representing the number of points; points, a list of strings representing the names of each point [i]; Coordinates, a list of integers representing the X coordinates of each point[i]; yCoordinates, a list of integers representing the Y coordinates of each point[i]; numOfQueriedPoints, an integer representing the number of points queried; queriedPoints, a list of strings representing the names of the queried points. Output Return a list of strings representing the name of the nearest points that shares either an x or a y coordinate with the queried point
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started