Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit67da0e7

Browse files
refactor 1290
1 parent3a1bfc6 commit67da0e7

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

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

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,6 @@
22

33
importcom.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
publicclass_1290 {
426
publicstaticclassSolution1 {
437
publicintgetDecimalValue(ListNodehead) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp