The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 4 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Gagan likes to teach his juniors. One day he was teaching and getting very disturbed by the continuous talking of the students in the first row. He thought a way to make them quiet by seperating them.He wants the students to sit on benches such that the minimum distance between any two benches be as large as possible.He is having one problem that some of the benches in between are broken so no one can sit on it.
He wants you to help her out.
Note: He gets distracted by only first row students.
Print the largest minimum distance between any two benches.
Â
Input: 2 5 2 1 5 3 7 11 7 3 3 9 6 11 15 20 23 Output: 10 8
Â
Example case 1.Two students are made to sit on 1st and 11th bench.Therefore largest minimum distance is 10.
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll