Question: please write in java please use parameters as provided Given a list of points, find the nearest points that shares either an xora y coordinate
please write in java
please use parameters as provided Given a list of points, find the nearest points that shares either an xora y coordinate with the queried point The distance is denoted on a Euclidean plane the difference in x plus the difference in y Input rumOfPoints, an integer representing the number of points points, a list of strings representing the names of each point xcoordinates a list of integers representing the X coordinates of each pontol, Coordinates, a list of integers cepresenting the coordinates of each points numeriodPoints, an integer representing the number of points queriod QueriedPoints a la of strings representing the names of the quened points Output Rournalist of strings representing the name of the nearest points that shares other an xora y coordinate with the quandpoint 1 - import java.util."; 2 import java.io.*; 3 import java.lang."; 4 5 //If no other cities share an x or y coordinate, return null 6 - public class Solution { 7- public String[] findNearestCities (int numOfPoints, String[] points, int[] xCoordinates, 10 int[] yCoordinates, 11 int numOfQueriedPoints, StringqueriedPoints) { 13
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
