maze-runnar / interview-preparation-kit

Interview preparation kit of hackerrank solutions
https://maze-runnar.github.io/interview-preparation-kit/
MIT License
192 stars 77 forks source link

Solved Search questions #26

Closed RashakDude closed 4 years ago

RashakDude commented 4 years ago

@championballer I think the minimum time, in that case, would be 12 days. First starts 2 machines and after 2 days start another two and then repeat this. So after 6 days, 4 items. After 8 days, 6 items. After 10 days, 8 items and then after 12 days, 10 items.

championballer commented 4 years ago

@RashakDude can you check your code once because, I think your code will return 11 in that case.

RashakDude commented 4 years ago

@championballer You are right. I checked Geeks for Geeks, where the solution to that question comes out to be 12 instead of 11. Since all the test cases passed, and there was not this case you just mentioned, I dropped this solution. I too cannot find a way to do this in 11 days. If you could find a way please tell me too.

championballer commented 4 years ago

@maze-runnar how do you think this issue should be resolved?

RashakDude commented 4 years ago

@maze-runnar It will be a great help if you could review the code and tell me if there is a need to make changes. I am really motivated to contribute more to your repository.

maze-runnar commented 4 years ago

lower_bound = (goal // (len(machines) / low_rate)) + 1
upper_bound = (goal // (len(machines) / high_rate)) + 1

@RashakDude do these changes in your code and then check if your code is working then for that case said by @championballer .

maze-runnar commented 4 years ago

Also @championballer please make sure that after these changes code is working fine or not .

RashakDude commented 4 years ago

lower_bound = (goal // (len(machines) / low_rate)) + 1
upper_bound = (goal // (len(machines) / high_rate)) + 1

@RashakDude do these changes in your code and then check if your code is working then for that case said by @championballer .

I checked it @maze-runnar , my all test cases passed in this way but still I am getting 11 in the case mentioned by @championballer

RashakDude commented 4 years ago

@maze-runnar @championballer I have updated my code as per given solution in Geeks for Geeks. Now the test case suggested by @championballer is giving me solution to be 12

championballer commented 4 years ago

LGTM.