21. Merge Two Sorted Lists
Read carefully what the question [merge sorted list] is. Otherwise you would find out the misunderstanding may lead you to re-construct the code.
In linked list, if there are multiple input, try to consider modifying both two of them at a time in the loop, AND also think about handling ONLY ONE input at a time.
Eliminate bad cases first will help you get rid of some future design problems, since we have already make sure l1 and l2 are both not None.
Last updated