The code is returning -1 for all the cases and i cannot find my error acc to logic
hey @S19LPPP0192, you have made temp1 and temp2 as NULL after calculating count1 and count2, thatswhy while(temp1!=NULL && temp2!=NULL) is not working. Also make count1=count2=0 initially.
Here is your updated code with changes indicated as comments
Okay. Thankyou.!
It is running fine now.
hey @S19LPPP0192 , if your query is resolved. Please mark this doubt as resolved and rate me on the basis of your experience.
rating option will appear when to mark this doubt as resolved