+ 1

Super Sale C++

Hello, Please can you help in the following problem: In super sale c++ challenge test case 3,4,5 and 7 is failing and I cannot figure out why. It starts to drive me crazy 🤣 Here is the code; https://code.sololearn.com/coXjMsb9a245/?ref=app Thank you,

1st Feb 2022, 8:23 AM
György Kernya
3 Answers
+ 2
Your program seems to work fine for me, keep in mind I'm using the standard code playground and not the Code Coach for Super Sale since I don't have PRO subscription. This might seem optional, but I think you need to change line30 to: for (int i = 0; i < (int)vPrices.size(); i++) It would be best if you would post the question here as well, along with the Test Cases, since I won't be able to have access to that PRO Code Coach problem. You might also be interested in this previously discussed Q&A post: https://www.sololearn.com/Discuss/2490456/?ref=app
1st Feb 2022, 9:39 AM
Solomoni Railoa
Solomoni Railoa - avatar
+ 1
Hello, It seems like the problem was the for cycle. I separated it and made 2 different for cycle. Now every test case is passed. Solomoni Railoa thanks for the hint.
2nd Feb 2022, 8:07 AM
György Kernya
+ 1
You're welcome. Happy coding György Kernya !
2nd Feb 2022, 8:11 AM
Solomoni Railoa
Solomoni Railoa - avatar