Drone Flight Planner #129
Replies: 1 comment
-
Question: Given an array route of 3D points, implement a function calcDroneMinEnergy that computes and returns the minimal amount of energy the drone would need to complete its route. Assume that the drone starts its flight at the first point in route. That is, no energy was expended to place the drone at the starting point. For simplicity, every 3D point will be represented as an integer array whose length is 3. Also, the values at indexes 0, 1, and 2 represent the x, y and z coordinates in a 3D point, respectively. Explain your solution and analyze its time and space complexities. Example: input: route = [ [0, 2, 10], output: 5 # less than 5 kWh and the drone would crash before the finish [time limit] 5000ms [input] array.array.integer route 1 ≤ route.length ≤ 100 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions