+ 4

Help me find the error in my code.

Question :- www.hackerrank.com/challenges/electronics-shop/problem 9/16 test cases go wrong. Please find the error. My code : https://code.sololearn.com/cSKueYcBNi4l/?ref=app

30th Aug 2019, 2:00 PM
Manoj
Manoj - avatar
4 odpowiedzi
+ 2
Line 10: u need to also check there if the current combination is higher than the current value of maximum. Otherwise you just overwrite a potentially higher value.
30th Aug 2019, 6:45 PM
Thoq!
Thoq! - avatar
+ 3
You forgot to check if a certain combination is greater than the maximum. You only check if it is less or equal to the budget.
30th Aug 2019, 2:16 PM
Thoq!
Thoq! - avatar
+ 1
Thoq! Can you make it clear. I think I've included all the constraints.
30th Aug 2019, 6:06 PM
Manoj
Manoj - avatar
0
You don't code any input string or integer (I explained that in Java).
1st Sep 2019, 6:04 AM
رسا فرجی
رسا فرجی - avatar