1290
This commit is contained in:
12
src/1290.c
Normal file
12
src/1290.c
Normal file
@@ -0,0 +1,12 @@
|
||||
#include <solution/1290.h>
|
||||
|
||||
int getDecimalValue(struct ListNode *head)
|
||||
{
|
||||
int x = 0;
|
||||
while (head)
|
||||
{
|
||||
x = (x << 1) + head->val;
|
||||
head = head->next;
|
||||
}
|
||||
return x;
|
||||
}
|
||||
Reference in New Issue
Block a user