Tap here to switch tabs
Problem
Submissions

Problem: Convert Binary Number in a Linked List to Integer

med
30 min
Try to solve the Convert Binary Number in a Linked List to Integer problem.

Statement

Given the head node head of a singly linked list, where each node stores a binary digit, interpret the sequence of node values from head to the tail as a binary number and return its value in base 1010.

Note: The most significant bit is at head.

Constraints:

  • The linked list is not empty.

  • The number of nodes in the linked list does not exceed 3030.

  • Each node’s value is either 00 or 11.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Convert Binary Number in a Linked List to Integer

med
30 min
Try to solve the Convert Binary Number in a Linked List to Integer problem.

Statement

Given the head node head of a singly linked list, where each node stores a binary digit, interpret the sequence of node values from head to the tail as a binary number and return its value in base 1010.

Note: The most significant bit is at head.

Constraints:

  • The linked list is not empty.

  • The number of nodes in the linked list does not exceed 3030.

  • Each node’s value is either 00 or 11.