Solved! Leetcode 2816. Double a Number Represented as a Linked List

Table of ContentsDescription: Double a Number Represented as a Linked ListExample 1Example 2ConstraintsSolutionTime ComplexitySpace Complexity Description: Double a Number Represented as a Linked List You are given the head of a non-empty linked list representing a non-negative integer without leading zeroes. Return the head of the linked list after doubling it. Example 1 <strong>Input:</strong> head = [1,8,9] <strong>Output:</strong> [3,7,8] <strong>Explanation:</strong> The figure above corresponds ...

Solved! Leetcode 2487. Remove Nodes From Linked List

Table of ContentsDescription: Remove Nodes From Linked ListExample 1Example 2ConstraintsSolutionTime ComplexitySpace Complexity Description: Remove Nodes From Linked List You are given the head of a linked list. Remove every node which has a node with a greater value anywhere to the right side of it. Return the head of the modified linked list. Example 1 <strong>Input:</strong> head = [5,2,13,3,8] <strong>Output:</strong> ...

Solved! Leetcode 1669. Merge In Between Linked Lists

Table of ContentsMerge In Between Linked ListsDescriptionExample 1Example 2ConstraintsApproachSolution Merge In Between Linked Lists Description You are given two linked lists: list1 and list2 of sizes n and m respectively. Remove list1‘s nodes from the ath node to the bth node, and put list2 in their place. The blue edges and nodes in the following figure indicate the result: Build the result list and return its head. Example 1 <strong>Input:</strong> ...

Solved! Leetcode 2130. Maximum Twin Sum of a Linked List

source: https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list/description/ Maximum Twin Sum of a Linked List In a linked list of size n, where n is even, the ith node (0-indexed) of the linked list is known as the twin of the (n-1-i)th node, if 0 <= i <= (n / 2) – 1. For example, if n = 4, then node ...

Solved! Leetcode 369. Plus One Linked List

source: https://leetcode.com/problems/plus-one-linked-list/description/ Plus One Linked List Given a non-negative integer represented as a linked list of digits, plus one to the integer. The digits are stored such that the most significant digit is at the head of the list. Example 1: Input: head = [1,2,3] Output: [1,2,4] Example 2: Input: head = [0] Output: [1] ...