Tap here to switch tabs
Problem
Submissions

Problem: Plus One Linked List

med
30 min
Try to solve the Plus One Linked List problem.

Statement

Given the head of a non empty singly linked list representing a non negative integer, increment the integer by 11 and return the head of the updated linked list.

The most significant digit is located at the head of the list, and each node contains a single digit.

Constraints:

  • The number of nodes in the linked list is in the range [1,100][1, 100].

  • 0≤0 \leq Node.val ≤9\leq 9

  • The number represented by the linked list does not contain leading zeros except for the zero itself.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Plus One Linked List

med
30 min
Try to solve the Plus One Linked List problem.

Statement

Given the head of a non empty singly linked list representing a non negative integer, increment the integer by 11 and return the head of the updated linked list.

The most significant digit is located at the head of the list, and each node contains a single digit.

Constraints:

  • The number of nodes in the linked list is in the range [1,100][1, 100].

  • 0≤0 \leq Node.val ≤9\leq 9

  • The number represented by the linked list does not contain leading zeros except for the zero itself.