Рет қаралды 681
Autocomplete Ready 1. Code Question 1 1. import java.io. 14 15 class Result 16 17 18 Complete the countIdleRobots function below. 19 20 The function is expected to return an INTEGER 21 The function accepts following parameters 22 1. INTEGER_ARRAY X 23 2. INTEGER_ARRAY y 24 25 26 public static int countIdleRobots(ListInteger x, ListInteger y) 27 write your code here 28 29 - 30 31 12 33 public class Solution Amazon uses small Roomba-shaped robots called Drives. They deliver large stacks of products to human workers by following set paths around the warehouse. The warehouse can be represented in the form of a Cartesian plane, where robots are located at integral points of the form (x, y). When a product is to be delivered to some point, the nearest robot is sought and chosen. Thus, if a robot is surrounded by other robots nearby, it will seldom be chosen for work. More formally, a robot is said to be idle if it has a robot located above, below, left, and right of it. It is guaranteed that no two robots are at the same location. ALL 1 Given the locations of n robots, find the number of idle robots. Example The x and y coordinates are given as two arrays with the coordinates aligned by index. x = [2, 2, 2, 2, 3, 3, 1] and y = [1, 2, 3, 1, 2, 3, 5]. The output should be 2. Test Results Custom input
Most Viewed Playlist of HomeworkLIB KZbin Channel
📕 #Economics Q&A - tinyurl.com/2s...
📕 #Chemistry Q&A - tinyurl.com/3r...
📕 #Math Q&A - tinyurl.com/32...
📕 #Statistics Q&A - tinyurl.com/4y...
📕 #Psychology - tinyurl.com/46...
📕 #Computerscience Q&A -tinyurl.com/3e...
📕 #Accounting Q&A - tinyurl.com/23...
📕 #Biology Q&A - tinyurl.com/yc...
📕 #Physics Q&A - tinyurl.com/28...
#qnawire
#qna
#homework
#mathematics
#science
#history
#literature
#computerscience
#economics
#psychology
#geography
#arts
#AcademicAssignments
#EducationalTasksandProjects
#LearningAssignmentsandExercises
#MathematicalConceptsandTheories
#PrinciplesofMathematicsandItsApplications
#MathematicalProblemSolvingTechniques
#StudyofNaturalPhenomenaandLaws
#ScientificExplorationandInquiry
#EmpiricalInvestigationandAnalysis
#ExplorationofPastEventsandCivilizations
#AnalysisofHistoricalContextsandDevelopment
#UnderstandingtheEvolutionofSocietiesandCultures
#AnalysisandInterpretationofLiteraryWorks
#ExplorationofLiteraryThemesandMotifs
#StudyofLiteraryMovementsandStyles
#UnderstandingComputingTechnology and Systems
#AnalysisofMarketDynamicsandEconomicPolicies
#ExplorationofHumanBehaviorandMentalProcesses
#AnalysisofPsychologicalTheoriesandConstructs
#StudyofMentalHealthandWell-being
#ExaminationofEarth'sPhysicalFeaturesandEnvironments
#AnalysisofHumanGeographyandSpatialRelationships
#UnderstandingGeographicPatternsandProcesses
#ExplorationofArtisticExpressionCreativity
#StudyofVisualandPerformingArtsForms
#AnalysisofCulturalSignificanceandArtisticMovements
#Assignments
#Studytasks
#Academictasks
#Algebra
#Geometry
#Calculus
#Arithmetic
#Trigonometry
#Biology
#Chemistry
#Physics
#Astronomy
#Earthscience
#Worldhistory
#Ancienthistory
#Modernhistory
#Historicalevents
#Civilization
#Fiction
#Poetry
#Prose
#Literaryanalysis
#Literarycriticism
#Programming
#Algorithms
#Datastructures
#Softwareengineering
#Computernetworks
#Microeconomics
#Macroeconomics
#Economictheory
#Marketanalysis
#Economicpolicies
#Behavioralpsychology
#Cognitivepsychology
#Developmentalpsychology
#Clinicalpsychology
#Socialpsychology
#Physicalgeography
#Humangeography
#Cartography
#Geographicinformationsystems(GIS)
#Environmentalgeography
🎯🎯🎯🎯
Follow us on Social Media for Latest updates
Instagram - @qna_wire
Facebook - @qna_wire
Twitter - @qna_wire
👍👍👍👍👍👍👍👍