Solution Review: Pairs with Sums
This lesson contains the solution review for the challenge of finding pairs in a doubly linked list which sum up to the given number.
We'll cover the following...
We'll cover the following...
Here is an overview of our solution to finding a pair of nodes in a doubly linked list that sums up to a specific number.
Implementation
Here is the coding solution in Python for the previous challenge:
Explanation
On line 2, pairs is initialized to an empty Python list. In the next lines (lines 3-4), p and q are set equal to self.head ...