My code is not getting the correct output
plz help
Unable to understand the test case
Hello @NKushal i have corrected your code and commented the error.
if you have any doubt you can ask here:
Happy Learning!!
But sir, In the question, we were asked to use an array, why we aren’t doing that …
Hello @NKushal it is the same way around you can take the input in the form of array and then send the elements like the way i am sending it now.
do you want me to share the code in that way?
actually the main logic is of deleting the nodes storing the elements is not the main logic.
Happy Learning!!