You are viewing a single comment's thread. Return to all comments →
You are right. We can just have:
if(headA == NULL){ return headB; } else if(headB == NULL){ return headA; }
here is problem solution in python java c++ and c programming. https://solution.programmingoneonone.com/2020/07/hackerrank-merge-two-sorted-linked-lists-solution.html
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Merge two sorted linked lists
You are viewing a single comment's thread. Return to all comments →
You are right. We can just have:
here is problem solution in python java c++ and c programming. https://solution.programmingoneonone.com/2020/07/hackerrank-merge-two-sorted-linked-lists-solution.html