Can you please suggest how can this be improved?
Not able to even get remotely close to the logic behind these codes
also,how would i know which other data structure is to be used like “stacks” in this case!!
Hi @himanshuep32,
Everything comes with practice … Firstly to understand a code focus on the flow. Meaning how the code is solving the problem rather than what is used . Use a paper and pen to dry run the code. Once you get the flow the solution will be rather simpler. Stack are just a basic data structure which offer you to access the last pushed item . So once you get good practice in how to approach a code you will yourself know when using stack will be beneficial and when not. Again practice and it would eventually become easy and for understanding it is highly recommended to dry run the code with paper and pen.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.