Leetcode 0002. Add Two Numbers

Posted on Sun 27 November 2022 in Leetcode • Tagged with linked-list, dummy-list-head

Question Link : https://leetcode.com/problems/add-two-numbers/

Difficulty: Medium

Premium: False

Question

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 contains a single digit. Add the two numbers and return the sum as a linked …


Continue reading

Leetcode 0138. Copy List with Random Pointer

Posted on Fri 11 March 2022 in Leetcode • Tagged with linked-list, dummy-list-head, recursion

Question Link : https://leetcode.com/problems/copy-list-with-random-pointer/

Difficulty: Medium

Question

A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, or null. Construct a deep copy of the list. The deep copy should consist …


Continue reading