SVCE-ACM / A-December-of-Algorithms-2022

A December of Algorithms is a small collection of algorithms to implement this December. Finish it all to get a certificate. 🎄
MIT License
15 stars 90 forks source link

2nd Sample Input of Question 28 looks wrong as per Question. #68

Closed souvikpal2000 closed 1 year ago

souvikpal2000 commented 1 year ago

In the Question it is written that Array must be in Sorted Order but in the Input it is not in Sorted Order

{ 3, 10, 12, 13, 15, 17, 21, 35, 23 }

souvikpal2000 commented 1 year ago

And the output is also wrong it must be 2.783

neha2127 commented 1 year ago

There is no issue with the input and the output. The line about the array being sorted was an error and we apologize for the confusion.

souvikpal2000 commented 1 year ago

There is no issue with the input and the output. The line about the array being sorted was an error and we apologize for the confusion.

So as you said, line about the array being sorted was an error. Their is also an error with the Output. It will be 2.783 not 2.683.

Calculation :- Sorted Array will we { 3, 10, 12, 13, 15, 17, 21, 23, 35 } Total Time taken in seconds will be (10+3+12+3+13+3+15+3+17+3+21+3+23+3+35) = 167 seconds Converting it to minutes will be (167/60) = 2.783 minutes

neha2127 commented 1 year ago

The sum is actually 161 seconds. But I understand the confusion. It is not necessary that the same person must move back and forth. This was the case only for the first sample and is purely coincidental. Keeping this in mind, the minimum time between 161 and 167 is 161. I hope this clears it up.

souvikpal2000 commented 1 year ago

The sum is actually 161 seconds. But I understand the confusion. It is not necessary that the same person must move back and forth. This was the case only for the first sample and is purely coincidental. Keeping this in mind, the minimum time between 161 and 167 is 161. I hope this clears it up.

Can you tell the summation please how it comes 161. Please!!

And as you said that, It is not necessary that the same person must move back and forth, so in the given array there is no one moving in fast pace except the member who is at the 0th Position with 3 seconds. 167 seconds can only be achievable if the member at the 0th Position moves back and forth with the Breach Suit for the remaining tailie. Thank You.

neha2127 commented 1 year ago

Hi Giving the calculation will give the answer to the puzzle. It is what you must figure out. I'll give you a hint: you are considering only the first smallest time. You need to consider more than one. I have added a more simple sample for this approach. The answer is 161 seconds which is equal to 2.683 minutes.