+ 2
I need help with my c++ program
Hello Everyone! I have been trying to solve this problem, but i am not able to figure out where i am doing wrong. Please Help me, Thank you. https://code.sololearn.com/c7MMTbEH6Wxy/#cpp
4 Answers
+ 2
There's an old principle (really old, an English friar who lived in the 13th's century came up with it), called Occam's Razor. it's more relevant in the natural sciences, however it is just as appropriate here. Basically, it means "Keep it simple stupid", viz. don't add unnecessary complexity to a problem or idea that can be solved simply or explained easily.
@Martin Taylor gave you the necessary hints that you need. All you need now is to give it a shot. If you still can't understand it, I can link you my solution which solves it without the need for any container classes.
+ 1
Martin Taylor
https://code.sololearn.com/cZXjrFh751uZ/#cpp
Thanks for the hint, martin. It helped me to figure out the logic. I am neither a beginner nor a professional, just a decent uni student trying to learn data structure and competitive programming. I chose c++ over c because of its extensive support for the standard template library.