Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Add Two Numbers (Medium 2)

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.

Solution:

Click here Iterate while you still have nodes in any list or carry. Keep adding new nodes to resulting list. O(max(n, m)) time, O(max(n, m)) space.

Installation

Run make to run python and Swift files.