https://leetcode.com/problems/merge-two-sorted-lists/
This is fairly straightforward problem – the only tricky part being the pointer manipulation associated with any LinkedList related question – but that gets better over time with practice.
Optimal solution takes O(N) time (where N = m + n i.e. addition of the two lists) and O(1) space.
Since the two lists are sorted, we need to pick the smaller element in each iteration and move the pointer ahead for the associated list. At the end, we should not forget to pick off the remaining items from the longer list.
With Swift, using the while let loop operator does make the code a lot easier to reason about.