Skip to content

Commit 67da0e7

Browse files
refactor 1290
1 parent 3a1bfc6 commit 67da0e7

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

src/main/java/com/fishercoder/solutions/_1290.java

-36
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,6 @@
22

33
import com.fishercoder.common.classes.ListNode;
44

5-
/**
6-
* 1290. Convert Binary Number in a Linked List to Integer
7-
*
8-
* Given head which is a reference node to a singly-linked list.
9-
* The value of each node in the linked list is either 0 or 1.
10-
* The linked list holds the binary representation of a number.
11-
*
12-
* Return the decimal value of the number in the linked list.
13-
*
14-
* Example 1:
15-
* Input: head = [1,0,1]
16-
* Output: 5
17-
* Explanation: (101) in base 2 = (5) in base 10
18-
*
19-
* Example 2:
20-
* Input: head = [0]
21-
* Output: 0
22-
*
23-
* Example 3:
24-
* Input: head = [1]
25-
* Output: 1
26-
*
27-
* Example 4:
28-
* Input: head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0]
29-
* Output: 18880
30-
*
31-
* Example 5:
32-
* Input: head = [0,0]
33-
* Output: 0
34-
*
35-
* Constraints:
36-
*
37-
* The Linked List is not empty.
38-
* Number of nodes will not exceed 30.
39-
* Each node's value is either 0 or 1.
40-
* */
415
public class _1290 {
426
public static class Solution1 {
437
public int getDecimalValue(ListNode head) {

0 commit comments

Comments
 (0)