Question: Solve using Pyhton please There are N trees (numbered from 0 to N-1) in a forest. The K- th tree is located at coordinates (X[K],

Solve using Pyhton please Solve using Pyhton please There are N trees (numbered from 0 to

There are N trees (numbered from 0 to N-1) in a forest. The K- th tree is located at coordinates (X[K], Y[K]). We want to build the widest possible vertical path, such that there is no tree on it. The path must be built somewhere between a leftmost and a rightmost tree, which means that the width of the path cannot be infinite. What is the width of the widest possible path that can be built? Write a function: a int solution(vector &x, vector &Y); that, given two arrays X and Y consisting of N integers each, denoting the positions of trees, returns the width of the widest possible path that can be built

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!