{"id":111,"date":"2021-08-02T12:33:18","date_gmt":"2021-08-02T04:33:18","guid":{"rendered":"http:\/\/dmoe.nicolite.cn\/?p=111"},"modified":"2021-08-03T15:37:46","modified_gmt":"2021-08-03T07:37:46","slug":"leetcode1290","status":"publish","type":"post","link":"https:\/\/dmoe.nicolite.cn\/?p=111","title":{"rendered":"LeetCode1290"},"content":{"rendered":"\n<p>\u5730\u5740\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/leetcode-cn.com\/problems\/convert-binary-number-in-a-linked-list-to-integer\/\" target=\"_blank\">1290. \u4e8c\u8fdb\u5236\u94fe\u8868\u8f6c\u6574\u6570<\/a><\/p>\n\n\n\n<p>\u94fe\u8868\u7684\u524d\u9762\u7684\u8282\u70b9\u662f\u4e8c\u8fdb\u5236\u6570\u7684\u9ad8\u4f4d\uff0c\u6240\u4ee5\u53ef\u4ee5\u901a\u8fc7\u79fb\u4f4d\u7136\u540e\u53d6\u6216\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u8bed\u8a00 Java\uff1a<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Definition for singly-linked list.\n * public class ListNode {\n *     int val;\n *     ListNode next;\n *     ListNode(int x) { val = x; }\n * }\n *\/\nclass Solution {\n    public int getDecimalValue(ListNode head) {\n        int r = 0;\n        for(; head != null; head = head.next) {\n            r = (r &lt;&lt; 1) | head.val;\n        }\n        return r;\n    }\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u8bed\u8a00  Golang\uff1a<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * Definition for singly-linked list.\n * type ListNode struct {\n *     Val int\n *     Next *ListNode\n * }\n *\/\nfunc getDecimalValue(head *ListNode) int {\n    r := 0\n    for ; head != nil; head = head.Next {\n        r = (r &lt;&lt; 1) | head.Val\n    }\n    return r;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5730\u5740\uff1a1290. \u4e8c\u8fdb\u5236\u94fe\u8868\u8f6c\u6574\u6570 \u94fe\u8868\u7684\u524d\u9762\u7684\u8282\u70b9\u662f\u4e8c\u8fdb\u5236\u6570\u7684\u9ad8\u4f4d\uff0c\u6240\u4ee5\u53ef\u4ee5\u901a\u8fc7\u79fb\u4f4d\u7136\u540e\u53d6\u6216\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u3002  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,15],"tags":[17,18],"class_list":["post-111","post","type-post","status-publish","format-standard","hentry","category-leetcode","category-15","tag-leetcode","tag-18"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"_links":{"self":[{"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=\/wp\/v2\/posts\/111","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=111"}],"version-history":[{"count":0,"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=\/wp\/v2\/posts\/111\/revisions"}],"wp:attachment":[{"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=111"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=111"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dmoe.nicolite.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=111"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}