{"id":6187,"date":"2020-01-31T08:26:44","date_gmt":"2020-01-31T16:26:44","guid":{"rendered":"https:\/\/zxi.mytechroad.com\/blog\/?page_id=6187"},"modified":"2020-02-03T23:11:59","modified_gmt":"2020-02-04T07:11:59","slug":"leetcode-problem-categories","status":"publish","type":"page","link":"https:\/\/zxi.mytechroad.com\/blog\/leetcode-problem-categories\/","title":{"rendered":"\u82b1\u82b1\u9171 LeetCode Problem List \u9898\u76ee\u5217\u8868"},"content":{"rendered":"\n<p>Data source: <a href=\"https:\/\/docs.google.com\/spreadsheets\/d\/1yRCOJ8KysRVkq0O9IlDriT01tC6lzPapmFO4PCmDJQA\/edit?usp=sharing\" target=\"_blank\" rel=\"noopener noreferrer\">link<\/a>  suggestions and comments are welcome\uff08\u9700\u8981\u79d1\u5b66\u4e0a\u7f51\uff09<\/p>\n\n\n\n<br\/><h2>Tree\uff08\u6811\uff09<\/h2><style nonce=J1QQUgVPwTdCcyYiG0MQqA type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s16{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s11{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:top;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s10{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s2{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s5{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:middle;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s18{border-bottom:1px SOLID #000000;border-bottom:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s4{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:middle;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s15{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s0{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s14{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;}.ritz .waffle .s12{border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s9{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s3{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s1{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s6{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:middle;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s13{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s8{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s17{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s7{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=0 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=0C0 style=width:29px> <\/th> <th class=header-shim id=0C1 style=width:255px> <\/th> <th class=header-shim id=0C2 style=width:56px> <\/th> <th class=header-shim id=0C3 style=width:50px> <\/th> <th class=header-shim id=0C4 style=width:50px> <\/th> <th class=header-shim id=0C5 style=width:50px> <\/th> <th class=header-shim id=0C6 style=width:50px> <\/th> <th class=header-shim id=0C7 style=width:50px> <\/th> <th class=header-shim id=0C8 style=width:175px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s0 dir=ltr> Id <\/td> <td class=s1 dir=ltr> Name <\/td> <td class=s2 dir=ltr> Difficulty <\/td> <td class=s2 colspan=5 dir=ltr> Similar Problems <\/td> <td class=s3 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s4 dir=ltr rowspan=2> 94 <\/td> <td class=s5 dir=ltr rowspan=2> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-94-binary-tree-inorder-traversal\/ > Binary Tree Inorder Traversal <\/a> <\/td> <td class=s6 dir=ltr rowspan=2> \u2605 <\/td> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-144-binary-tree-preorder-traversal\/ > 144 <\/a> <\/td> <td class=s8 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-145-binary-tree-postorder-traversal\/ > 145 <\/a> <\/td> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-429-n-ary-tree-level-order-traversal\/ > 429 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-589-n-ary-tree-preorder-traversal\/ > 589 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-590-n-ary-tree-postorder-traversal\/ > 590 <\/a> <\/td> <td class=s3 dir=ltr> traversal <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-987-vertical-order-traversal-of-a-binary-tree\/ > 987 <\/a> <\/td> <td class=s10 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-1302-deepest-leaves-sum\/ > 1302 <\/a> <\/td> <td class=s0 dir=ltr> <\/td> <td class=s0 dir=ltr> <\/td> <td class=s0 dir=ltr> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s4 dir=ltr rowspan=2> 100 <\/td> <td class=s11 dir=ltr rowspan=2> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-100-same-tree\/ > Same Tree <\/a> <\/td> <td class=s6 dir=ltr rowspan=2> \u2605\u2605 <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-101-symmetric-tree\/ > 101 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-104-maximum-depth-of-binary-tree\/ > 104 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-110-balanced-binary-tree\/ > 110 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-111-minimum-depth-of-binary-tree\/ > 111 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/subtree-of-another-tree> 572 <\/a> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s9 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/univalued-binary-tree\/ > 965 <\/a> <\/td> <td class=s0 dir=ltr> <\/td> <td class=s0 dir=ltr> <\/td> <td class=s12 dir=ltr> <\/td> <td class=s0 dir=ltr> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R5 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 6 <\/div> <\/th> <td class=s0 dir=ltr> 102 <\/td> <td class=s13 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-102-binary-tree-level-order-traversal\/ > Binary Tree Level Order Traversal <\/a> <\/td> <td class=s2 dir=ltr> \u2605\u2605 <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-107-binary-tree-level-order-traversal-ii\/ > 107 <\/a> <\/td> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-429-n-ary-tree-level-order-traversal\/ > 429 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-872-leaf-similar-trees\/ > 872 <\/a> <\/td> <td class=s14> <\/td> <td class=s0> <\/td> <td class=s3 dir=ltr> collecting nodes <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R6 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 7 <\/div> <\/th> <td class=s0 dir=ltr> 814 <\/td> <td class=s13 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-814-binary-tree-pruning\/ > Binary Tree Pruning <\/a> <\/td> <td class=s2 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-669-trim-a-binary-search-tree\/ > 669 <\/a> <\/td> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-1325-delete-leaves-with-a-given-value\/ > 1325 <\/a> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R7 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 8 <\/div> <\/th> <td class=s0 dir=ltr> 112 <\/td> <td class=s15 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-112-path-sum\/ > Path Sum <\/a> <\/td> <td class=s2 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-113-path-sum-ii\/ > 113 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-437-path-sum-iii\/ > 437 <\/a> <\/td> <td class=s3> <\/td> <td class=s0 dir=ltr> <\/td> <td class=s0> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R8 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 9 <\/div> <\/th> <td class=s0 dir=ltr> 129 <\/td> <td class=s16 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-129-sum-root-to-leaf-numbers\/ > Sum Root to Leaf Numbers <\/a> <\/td> <td class=s2 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-257-binary-tree-paths\/ > 257 <\/a> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R9 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 10 <\/div> <\/th> <td class=s0 dir=ltr> 236 <\/td> <td class=s16 dir=ltr> <div class=softmerge-inner style=\"width: 252px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-236-lowest-common-ancestor-of-a-binary-tree\/ > Lowest Common Ancestor of a Binary Tree <\/a> <\/div> <\/td> <td class=s2 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-235-lowest-common-ancestor-of-a-binary-search-tree\/ > 235 <\/a> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R10 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 11 <\/div> <\/th> <td class=s0 dir=ltr> 297 <\/td> <td class=s17 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-297-serialize-and-deserialize-binary-tree\/ > Serialize and Deserialize Binary Tree <\/a> <\/td> <td class=s2 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-449-serialize-and-deserialize-bst\/ > 449 <\/a> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R11 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 12 <\/div> <\/th> <td class=s0 dir=ltr> 508 <\/td> <td class=s16 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-508-most-frequent-subtree-sum\/ > Most Frequent Subtree Sum <\/a> <\/td> <td class=s2 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s0 dir=ltr> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s3> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R12 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 13 <\/div> <\/th> <td class=s0 dir=ltr> 124 <\/td> <td class=s17 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-124-binary-tree-maximum-path-sum\/ > Binary Tree Maximum Path Sum <\/a> <\/td> <td class=s2 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-543-diameter-of-binary-tree\/ > 543 <\/a> <\/td> <td class=s9 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-687-longest-univalue-path\/ > 687 <\/a> <\/td> <td class=s3> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s18 dir=ltr> <div class=softmerge-inner style=\"width: 273px; left: -1px;\"> Use both children, return one <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=0R13 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 14 <\/div> <\/th> <td class=s0 dir=ltr> 968 <\/td> <td class=s17 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-968-binary-tree-cameras\/ > Binary Tree Cameras <\/a> <\/td> <td class=s2 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-337-house-robber-iii\/ > 337 <\/a> <\/td> <td class=s7 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-979-distribute-coins-in-binary-tree\/ > 979 <\/a> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s0> <\/td> <td class=s3> <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> <br\/><h2>Divide and conquer\uff08\u5206\u6cbb\uff09<\/h2><style nonce=2mLEfMheDcpnixibcNI33g type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s23{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s20{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s21{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s25{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s22{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s24{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s26{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=1486450114 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=1486450114C0 style=width:29px> <\/th> <th class=header-shim id=1486450114C1 style=width:259px> <\/th> <th class=header-shim id=1486450114C2 style=width:56px> <\/th> <th class=header-shim id=1486450114C3 style=width:50px> <\/th> <th class=header-shim id=1486450114C4 style=width:50px> <\/th> <th class=header-shim id=1486450114C5 style=width:50px> <\/th> <th class=header-shim id=1486450114C6 style=width:50px> <\/th> <th class=header-shim id=1486450114C7 style=width:50px> <\/th> <th class=header-shim id=1486450114C8 style=width:239px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1486450114R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s26 dir=ltr> Id <\/td> <td class=s20 dir=ltr> Name <\/td> <td class=s21 dir=ltr> Difficulty <\/td> <td class=s21 colspan=5 dir=ltr> Similar Problems <\/td> <td class=s20 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1486450114R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s26 dir=ltr> 169 <\/td> <td class=s22 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/divide-and-conquer\/leetcode-169-majority-element\/ > Majority Element <\/a> <\/td> <td class=s21 dir=ltr> \u2605\u2605 <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26> <\/td> <td class=s26> <\/td> <td class=s26> <\/td> <td class=s20 dir=ltr> \u4f60\u77e5\u9053\u8334\u9999\u8c46\u7684\u8334\u6709\u51e0\u79cd\u5199\u6cd5\u5417\uff1f <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1486450114R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s26 dir=ltr> 153 <\/td> <td class=s23 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-153-find-minimum-in-rotated-sorted-array\/ > Find Minimum in Rotated Sorted Array <\/a> <\/td> <td class=s21 dir=ltr> \u2605\u2605 <\/td> <td class=s24 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/divide-and-conquer\/leetcode-154-find-minimum-in-rotated-sorted-array-ii\/ > 154 <\/a> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s20 dir=ltr> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1486450114R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s26 dir=ltr> 912 <\/td> <td class=s23 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/array\/leetcode-912-sort-an-array\/ > Sort and Array <\/a> <\/td> <td class=s21 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s20 dir=ltr> merge sort <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1486450114R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s26 dir=ltr> 315 <\/td> <td class=s25 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/count-of-smaller-numbers-after-self\/ > Count of Smaller Numbers After Self <\/a> <\/td> <td class=s21 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s26 dir=ltr> <\/td> <td class=s20 dir=ltr> merge sort \/ BIT <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> <br\/><h2>List\uff08\u94fe\u8868\uff09<\/h2><style nonce=JV07OO3NnfpSpPHAB2maRA type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s32{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s28{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s30{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s29{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s31{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s27{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=410905529 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=410905529C0 style=width:29px> <\/th> <th class=header-shim id=410905529C1 style=width:259px> <\/th> <th class=header-shim id=410905529C2 style=width:56px> <\/th> <th class=header-shim id=410905529C3 style=width:50px> <\/th> <th class=header-shim id=410905529C4 style=width:50px> <\/th> <th class=header-shim id=410905529C5 style=width:50px> <\/th> <th class=header-shim id=410905529C6 style=width:50px> <\/th> <th class=header-shim id=410905529C7 style=width:50px> <\/th> <th class=header-shim id=410905529C8 style=width:50px> <\/th> <th class=header-shim id=410905529C9 style=width:50px> <\/th> <th class=header-shim id=410905529C10 style=width:202px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s27 dir=ltr> Id <\/td> <td class=s28 dir=ltr> Name <\/td> <td class=s29 dir=ltr> Difficulty <\/td> <td class=s29 colspan=7 dir=ltr> Similar Problems <\/td> <td class=s28 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s27 dir=ltr> 2 <\/td> <td class=s30 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/simulation\/leetcode-2-add-two-numbers-2\/ > Add Two Numbers <\/a> <\/td> <td class=s29 dir=ltr> \u2605\u2605 <\/td> <td class=s31 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/list\/leetcode-445-add-two-numbers-ii\/ > 445 <\/a> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s28 dir=ltr> traversal <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s27 dir=ltr> 24 <\/td> <td class=s30 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/list\/leetcode-24-swap-nodes-in-pairs\/ > Swap Nodes in Pairs <\/a> <\/td> <td class=s29 dir=ltr> \u2605\u2605 <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s28> <\/td> <td class=s28 dir=ltr> reverse <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s27 dir=ltr> 206 <\/td> <td class=s30 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/list\/leetcode-206-reverse-linked-list\/ > Reverse Linked List <\/a> <\/td> <td class=s29 dir=ltr> \u2605\u2605 <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s28 dir=ltr> reverse <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s27 dir=ltr> 141 <\/td> <td class=s30 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/list\/leetcode-141-linked-list-cycle\/ > Linked List Cycle <\/a> <\/td> <td class=s29 dir=ltr> \u2605\u2605 <\/td> <td class=s31 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/linked-list-cycle-ii> 142 <\/a> <\/td> <td class=s27 dir=ltr> <\/td> <td class=s28> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s28 dir=ltr> fast\/slow <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R5 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 6 <\/div> <\/th> <td class=s27 dir=ltr> 23 <\/td> <td class=s30 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/list\/leetcode-23-merge-k-sorted-lists-2\/ > Merge k Sorted Lists <\/a> <\/td> <td class=s29 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s32 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-21-merge-two-sorted-lists\/ > 21 <\/a> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s28 dir=ltr> priority_queue \/ mergesort <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R6 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 7 <\/div> <\/th> <td class=s27 dir=ltr> 147 <\/td> <td class=s30 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/insertion-sort-list\/ > Insertion Sort List <\/a> <\/td> <td class=s29 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s28 dir=ltr> insertion sort <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R7 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 8 <\/div> <\/th> <td class=s27 dir=ltr> 148 <\/td> <td class=s30 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/divide-and-conquer\/leetcode-148-sort-list\/ > Sort List <\/a> <\/td> <td class=s29 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s28 dir=ltr> merge sort O(1) space <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=410905529R8 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 9 <\/div> <\/th> <td class=s27 dir=ltr> 707 <\/td> <td class=s30 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/list\/leetcode-707-design-linked-list\/ > Design Linked List <\/a> <\/td> <td class=s29 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s27> <\/td> <td class=s28> <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> \n<!-- in page -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-2404451723245401\"\n     data-ad-slot=\"4108005821\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<br\/><h2>BST\uff08\u4e8c\u53c9\u641c\u7d22\u6811\uff09<\/h2><style nonce=WuPWhleyQcm+71kkiSOd9A type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s36{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s34{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s35{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s37{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s33{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=972946549 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=972946549C0 style=width:29px> <\/th> <th class=header-shim id=972946549C1 style=width:259px> <\/th> <th class=header-shim id=972946549C2 style=width:56px> <\/th> <th class=header-shim id=972946549C3 style=width:60px> <\/th> <th class=header-shim id=972946549C4 style=width:60px> <\/th> <th class=header-shim id=972946549C5 style=width:60px> <\/th> <th class=header-shim id=972946549C6 style=width:60px> <\/th> <th class=header-shim id=972946549C7 style=width:60px> <\/th> <th class=header-shim id=972946549C8 style=width:100px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=972946549R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s33 dir=ltr> Id <\/td> <td class=s34 dir=ltr> Name <\/td> <td class=s35 dir=ltr> Difficulty <\/td> <td class=s35 colspan=5 dir=ltr> Similar Problems <\/td> <td class=s34 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=972946549R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s33 dir=ltr> 98 <\/td> <td class=s36 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-98-validate-binary-search-tree\/ > Validate Binary Search Tree <\/a> <\/td> <td class=s35 dir=ltr> \u2605\u2605 <\/td> <td class=s37 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-530-minimum-absolute-difference-in-bst\/ > 530 <\/a> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34 dir=ltr> inorder <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=972946549R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s33 dir=ltr> 700 <\/td> <td class=s37 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-700-search-in-a-binary-search-tree\/ > Search in a Binary Search Tree <\/a> <\/td> <td class=s35 dir=ltr> \u2605\u2605 <\/td> <td class=s36 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-701-insert-into-a-binary-search-tree\/ > 701 <\/a> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34 dir=ltr> binary search <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=972946549R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s33 dir=ltr> 230 <\/td> <td class=s36 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-230-kth-smallest-element-in-a-bst\/ > Kth Smallest Element in a BST <\/a> <\/td> <td class=s35 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34 dir=ltr> inorder <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=972946549R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s33 dir=ltr> 99 <\/td> <td class=s36 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-99-recover-binary-search-tree\/ > Recover Binary Search Tree <\/a> <\/td> <td class=s35 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34 dir=ltr> inorder <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=972946549R5 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 6 <\/div> <\/th> <td class=s33 dir=ltr> 108 <\/td> <td class=s37 dir=ltr> <div class=softmerge-inner style=\"width: 256px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-108-convert-sorted-array-to-binary-search-tree\/ > Convert Sorted Array to Binary Search Tree <\/a> <\/div> <\/td> <td class=s35 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34 dir=ltr> build BST <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=972946549R6 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 7 <\/div> <\/th> <td class=s33 dir=ltr> 501 <\/td> <td class=s36 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-501-find-mode-in-binary-search-tree\/ > Find Mode in Binary Search Tree <\/a> <\/td> <td class=s35 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34 dir=ltr> inorder <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=972946549R7 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 8 <\/div> <\/th> <td class=s33 dir=ltr> 450 <\/td> <td class=s36 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-450-delete-node-in-a-bst\/ > Delete Node in a BST <\/a> <\/td> <td class=s35 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34> <\/td> <td class=s34 dir=ltr> binary search <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> <br\/><h2>Graph\uff08\u56fe\u8bba\uff09<\/h2><style nonce=QRbPtrlomUUIoV5NVTyc8Q type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s43{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s39{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s41{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s40{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s44{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s45{border-bottom:1px SOLID #000000;border-bottom:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s46{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s42{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s38{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s47{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=1085385252 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=1085385252C0 style=width:35px> <\/th> <th class=header-shim id=1085385252C1 style=width:198px> <\/th> <th class=header-shim id=1085385252C2 style=width:72px> <\/th> <th class=header-shim id=1085385252C3 style=width:50px> <\/th> <th class=header-shim id=1085385252C4 style=width:50px> <\/th> <th class=header-shim id=1085385252C5 style=width:50px> <\/th> <th class=header-shim id=1085385252C6 style=width:50px> <\/th> <th class=header-shim id=1085385252C7 style=width:50px> <\/th> <th class=header-shim id=1085385252C8 style=width:188px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s38 dir=ltr> Id <\/td> <td class=s39 dir=ltr> Name <\/td> <td class=s40 dir=ltr> Difficulty <\/td> <td class=s40 colspan=5 dir=ltr> Similar Problems <\/td> <td class=s39 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s38 dir=ltr> 133 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-133-clone-graph\/ > Clone Graph <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605 <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/hashtable\/leetcode-138-copy-list-with-random-pointer\/ > 138 <\/a> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s39 dir=ltr> queue + hashtable <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s38 dir=ltr> 200 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-200-number-of-islands\/ > Number of Islands <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605 <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-547-friend-circles\/ > 547 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-733-flood-fill\/ > 695 <\/a> <\/td> <td class=s43 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/flood-fill\/ > 733 <\/a> <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-827-making-a-large-island\/ > 827 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-1162-as-far-from-land-as-possible\/ > 1162 <\/a> <\/td> <td class=s45> <div class=softmerge-inner style=\"width: 286px; left: -1px;\"> grid + connected components <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s38 dir=ltr> 841 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-841-keys-and-rooms\/ > Keys and Rooms <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605 <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-1202-smallest-string-with-swaps\/ > 1202 <\/a> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s39 dir=ltr> DFS, connected components <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s38 dir=ltr> 207 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-207-course-schedule\/ > Course Schedule <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-210-course-schedule-ii\/ > 210 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-802-find-eventual-safe-states\/ > 802 <\/a> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s39 dir=ltr> topology sorting <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R5 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 6 <\/div> <\/th> <td class=s38 dir=ltr> 399 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-399-evaluate-division\/ > Evaluate Division <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/string\/leetcode-839-similar-string-groups\/ > 839 <\/a> <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-952-largest-component-size-by-common-factor\/ > 952 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-990-satisfiability-of-equality-equations\/ > 990 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-721-accounts-merge\/ > 721 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/hashtable\/leetcode-737-sentence-similarity-ii\/ > 737 <\/a> <\/td> <td class=s39 dir=ltr> union find <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R6 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 7 <\/div> <\/th> <td class=s38 dir=ltr> 785 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-785-is-graph-bipartite\/ > Is Graph Bipartite? <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-886-possible-bipartition\/ > 886 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-1042-flower-planting-with-no-adjacent\/ > 1042 <\/a> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s39 dir=ltr> bipartition, graph coloring <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R7 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 8 <\/div> <\/th> <td class=s38 dir=ltr> 997 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-997-find-the-town-judge\/ > Find the Town Judge <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s46 dir=ltr> <\/td> <td class=s46 dir=ltr> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s39 dir=ltr> in\/out degrees <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R8 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 9 <\/div> <\/th> <td class=s38 dir=ltr> 433 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/string\/leetcode-433-minimum-genetic-mutation\/ > Minimum Genetic Mutation <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-815-bus-routes\/ > 815 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-863-all-nodes-distance-k-in-binary-tree\/ > 863 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-1129-shortest-path-with-alternating-colors\/ > 1129 <\/a> <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-1263-minimum-moves-to-move-a-box-to-their-target-location\/ > 1263 <\/a> <\/td> <td class=s38> <\/td> <td class=s45> <div class=softmerge-inner style=\"width: 286px; left: -1px;\"> unweighted shortest path \/ BFS <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R9 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 10 <\/div> <\/th> <td class=s38 dir=ltr> 684 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-684-redundant-connection\/ > Redundant Connection <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-685-redundant-connection-ii\/ > 685 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-1319-number-of-operations-to-make-network-connected\/ > 1319 <\/a> <\/td> <td class=s39> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s39 dir=ltr> cycle, union find <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R10 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 11 <\/div> <\/th> <td class=s38 dir=ltr> 743 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-743-network-delay-time\/ > Network Delay Time <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-787-cheapest-flights-within-k-stops\/ > 787 <\/a> <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-882-reachable-nodes-in-subdivided-graph\/ > 882 <\/a> <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-924-minimize-malware-spread\/ > 924 <\/a> <\/td> <td class=s42 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance\/ > 1334 <\/a> <\/td> <td class=s39> <\/td> <td class=s39 dir=ltr> weighted shortest path <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R11 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 12 <\/div> <\/th> <td class=s38 dir=ltr> 847 <\/td> <td class=s41 dir=ltr> <div class=softmerge-inner style=\"width: 195px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-847-shortest-path-visiting-all-nodes\/ > Shortest Path Visiting All Nodes <\/a> <\/div> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-864-shortest-path-to-get-all-keys\/ > 864 <\/a> <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-1298-maximum-candies-you-can-get-from-boxes\/ > 1298 <\/a> <\/td> <td class=s47> <\/td> <td class=s39> <\/td> <td class=s39> <\/td> <td class=s39 dir=ltr> BFS <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R12 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 13 <\/div> <\/th> <td class=s38 dir=ltr> 332 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-332-reconstruct-itinerary\/ > Reconstruct Itinerary <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s39> <\/td> <td class=s39> <\/td> <td class=s39 dir=ltr> Eulerian path <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R13 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 14 <\/div> <\/th> <td class=s38 dir=ltr> 1192 <\/td> <td class=s41 dir=ltr> <div class=softmerge-inner style=\"width: 195px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-1192-critical-connections-in-a-network\/ > Critical Connections in a Network <\/a> <\/div> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s39> <\/td> <td class=s39> <\/td> <td class=s39 dir=ltr> Tarjan <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R14 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 15 <\/div> <\/th> <td class=s38 dir=ltr> 943 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-943-find-the-shortest-superstring\/ > Find the Shortest Superstring <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605\u2605\u2605 <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-980-unique-paths-iii\/ > 980 <\/a> <\/td> <td class=s44 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-996-number-of-squareful-arrays\/ > 996 <\/a> <\/td> <td class=s38 dir=ltr> <\/td> <td class=s39> <\/td> <td class=s39> <\/td> <td class=s39 dir=ltr> Hamiltonian path (DFS \/ DP) <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1085385252R15 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 16 <\/div> <\/th> <td class=s38 dir=ltr> 959 <\/td> <td class=s41 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-959-regions-cut-by-slashes\/ > Regions Cut By Slashes <\/a> <\/td> <td class=s40 dir=ltr> \u2605\u2605\u2605\u2605\u2605 <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s38> <\/td> <td class=s39 dir=ltr> union find \/ grid + CCs <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> <br\/><h2>Search (BFS\/DFS)\uff08\u641c\u7d22\/\u56de\u6eaf\uff09<\/h2><style nonce=FrWtdo5KBydfYhpDwg2BRA type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s49{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s51{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s50{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s54{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s53{border-bottom:1px SOLID #000000;border-bottom:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s52{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s48{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=932160389 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=932160389C0 style=width:29px> <\/th> <th class=header-shim id=932160389C1 style=width:259px> <\/th> <th class=header-shim id=932160389C2 style=width:56px> <\/th> <th class=header-shim id=932160389C3 style=width:50px> <\/th> <th class=header-shim id=932160389C4 style=width:50px> <\/th> <th class=header-shim id=932160389C5 style=width:50px> <\/th> <th class=header-shim id=932160389C6 style=width:50px> <\/th> <th class=header-shim id=932160389C7 style=width:50px> <\/th> <th class=header-shim id=932160389C8 style=width:50px> <\/th> <th class=header-shim id=932160389C9 style=width:50px> <\/th> <th class=header-shim id=932160389C10 style=width:80px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s48 dir=ltr> Id <\/td> <td class=s49 dir=ltr> Name <\/td> <td class=s50 dir=ltr> Difficulty <\/td> <td class=s50 colspan=7 dir=ltr> Similar Problems <\/td> <td class=s49 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s48 dir=ltr> 17 <\/td> <td class=s51 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-17-letter-combinations-of-a-phone-number\/ > Letter Combinations of a Phone Number <\/a> <\/td> <td class=s50 dir=ltr> \u2605\u2605 <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-39-combination-sum\/ > 39 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-40-combination-sum-ii\/ > 40 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-77-combinations\/ > 77 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-78-subsets\/ > 78 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-90-subsets-ii\/ > 90 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-216-combination-sum-iii\/ > 216 <\/a> <\/td> <td class=s49> <\/td> <td class=s53 dir=ltr> <div class=softmerge-inner style=\"width: 178px; left: -1px;\"> Combination <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s48 dir=ltr> 46 <\/td> <td class=s51 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-46-permutations\/ > Permutations <\/a> <\/td> <td class=s50 dir=ltr> \u2605\u2605 <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-47-permutations-ii\/ > 47 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-784-letter-case-permutation\/ > 784 <\/a> <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-943-find-the-shortest-superstring\/ > 943 <\/a> <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-996-number-of-squareful-arrays\/ > 996 <\/a> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s49> <\/td> <td class=s49 dir=ltr> Permutation <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s48 dir=ltr> 22 <\/td> <td class=s51 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-22-generate-parentheses\/ > Generate Parentheses <\/a> <\/td> <td class=s50 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-301-remove-invalid-parentheses\/ > 301 <\/a> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s49> <\/td> <td class=s49 dir=ltr> DFS <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s48 dir=ltr> 37 <\/td> <td class=s51 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-37-sudoku-solver\/ > Sudoku Solver <\/a> <\/td> <td class=s50 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-51-n-queens\/ > 51 <\/a> <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-52-n-queens-ii\/ > 52 <\/a> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s49> <\/td> <td class=s49 dir=ltr> DFS <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R5 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 6 <\/div> <\/th> <td class=s48 dir=ltr> 79 <\/td> <td class=s51 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-79-word-search\/ > Word Search <\/a> <\/td> <td class=s50 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-212-word-search-ii\/ > 212 <\/a> <\/td> <td class=s48 dir=ltr> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s49 dir=ltr> DFS <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R6 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 7 <\/div> <\/th> <td class=s48 dir=ltr> 127 <\/td> <td class=s51 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/127-word-ladder\/ > Word Ladder <\/a> <\/td> <td class=s50 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-126-word-ladder-ii\/ > 126 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-752-open-the-lock\/ > 752 <\/a> <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-818-race-car\/ > 818 <\/a> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s49 dir=ltr> BFS <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R7 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 8 <\/div> <\/th> <td class=s48 dir=ltr> 542 <\/td> <td class=s51 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-542-01-matrix\/ > 01 Matrix <\/a> <\/td> <td class=s50 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-675-cut-off-trees-for-golf-event\/ > 675 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/graph\/leetcode-934-shortest-bridge\/ > 934 <\/a> <\/td> <td class=s49> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s49 dir=ltr> BFS <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=932160389R8 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 9 <\/div> <\/th> <td class=s48 dir=ltr> 698 <\/td> <td class=s51 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-698-partition-to-k-equal-sum-subsets\/ > Partition to K Equal Sum Subsets <\/a> <\/td> <td class=s50 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-93-restore-ip-addresses\/ > 93 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-131-palindrome-partitioning\/ > 131 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-241-different-ways-to-add-parentheses\/ > 241 <\/a> <\/td> <td class=s54 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-282-expression-add-operators\/ > 282 <\/a> <\/td> <td class=s52 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-842-split-array-into-fibonacci-sequence\/ > 842 <\/a> <\/td> <td class=s48> <\/td> <td class=s48> <\/td> <td class=s49 dir=ltr> Partition <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> \n<!-- in page -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-2404451723245401\"\n     data-ad-slot=\"4108005821\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<br\/><h2>Binary Search\uff08\u4e8c\u5206\u641c\u7d22\uff09<\/h2><style nonce=dtzLm65eP1ehKEevJAn5BQ type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s60{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s56{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s58{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s57{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s63{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s62{border-bottom:1px SOLID #000000;border-bottom:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s59{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s55{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s61{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=917471298 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=917471298C0 style=width:29px> <\/th> <th class=header-shim id=917471298C1 style=width:253px> <\/th> <th class=header-shim id=917471298C2 style=width:56px> <\/th> <th class=header-shim id=917471298C3 style=width:50px> <\/th> <th class=header-shim id=917471298C4 style=width:50px> <\/th> <th class=header-shim id=917471298C5 style=width:50px> <\/th> <th class=header-shim id=917471298C6 style=width:50px> <\/th> <th class=header-shim id=917471298C7 style=width:50px> <\/th> <th class=header-shim id=917471298C8 style=width:50px> <\/th> <th class=header-shim id=917471298C9 style=width:50px> <\/th> <th class=header-shim id=917471298C10 style=width:129px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s55 dir=ltr> Id <\/td> <td class=s56 dir=ltr> Name <\/td> <td class=s57 dir=ltr> Difficulty <\/td> <td class=s57 colspan=7 dir=ltr> Similar Problems <\/td> <td class=s56 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s55 dir=ltr> 35 <\/td> <td class=s58 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-35-search-insert-position\/ > Search Insert Position <\/a> <\/td> <td class=s57 dir=ltr> \u2605\u2605 <\/td> <td class=s59 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-34-find-first-and-last-position-of-element-in-sorted-array\/ > 34 <\/a> <\/td> <td class=s60 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/array\/leetcode-704-binary-search\/ > 704 <\/a> <\/td> <td class=s59 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/hashtable\/leetcode-981-time-based-key-value-store\/ > 981 <\/a> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s56> <\/td> <td class=s56 dir=ltr> upper_bound <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s55 dir=ltr> 33 <\/td> <td class=s58 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/search-in-rotated-sorted-array> Search in Rotated Sorted Array <\/a> <\/td> <td class=s57 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s59 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/search-in-rotated-sorted-array-ii\/ > 81 <\/a> <\/td> <td class=s59 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-153-find-minimum-in-rotated-sorted-array\/ > 153 <\/a> <\/td> <td class=s59 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/divide-and-conquer\/leetcode-154-find-minimum-in-rotated-sorted-array-ii\/ > 154 <\/a> <\/td> <td class=s59 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/%25e8%258a%25b1%25e8%258a%25b1%25e9%2585%25b1-leetcode-162-find-peak-element\/ > 162 <\/a> <\/td> <td class=s60 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-852-peak-index-in-a-mountain-array\/ > 852 <\/a> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s56> <\/td> <td class=s56 dir=ltr> rotated \/ peak <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s55 dir=ltr> 69 <\/td> <td class=s58 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/math\/leetcode-69-sqrtx\/ > Sqrt(x) <\/a> <\/td> <td class=s57 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s55 dir=ltr> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s56> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s56 dir=ltr> upper_bound <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s55 dir=ltr> 74 <\/td> <td class=s58 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-74-search-a-2d-matrix\/ > Search a 2D Matrix <\/a> <\/td> <td class=s57 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s55 dir=ltr> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s56> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s56 dir=ltr> treat 2d as 1d <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R5 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 6 <\/div> <\/th> <td class=s55 dir=ltr> 875 <\/td> <td class=s58 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-875-koko-eating-bananas\/ > Koko Eating Bananas <\/a> <\/td> <td class=s57 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s59 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-1011-capacity-to-ship-packages-within-d-days\/ > 1011 <\/a> <\/td> <td class=s61> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s62 dir=ltr> <div class=softmerge-inner style=\"width: 227px; left: -1px;\"> guess ans and check <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R6 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 7 <\/div> <\/th> <td class=s55 dir=ltr> 4 <\/td> <td class=s58 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-4-median-of-two-sorted-arrays\/ > Median of Two Sorted Arrays <\/a> <\/td> <td class=s57 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s56> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R7 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 8 <\/div> <\/th> <td class=s55 dir=ltr> 378 <\/td> <td class=s58 dir=ltr> <div class=softmerge-inner style=\"width: 250px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-378-kth-smallest-element-in-a-sorted-matrix\/ > Kth Smallest Element in a Sorted Matrix <\/a> <\/div> <\/td> <td class=s57 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s63 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/leetcode-668-kth-smallest-number-in-multiplication-table\/ > 668 <\/a> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s56 dir=ltr> kth + matrix <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=917471298R8 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 9 <\/div> <\/th> <td class=s55 dir=ltr> 719 <\/td> <td class=s58 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/divide-and-conquer\/leetcode-719-find-k-th-smallest-pair-distance\/ > Find K-th Smallest Pair Distance <\/a> <\/td> <td class=s57 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s63 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/two-pointers\/leetcode-786-k-th-smallest-prime-fraction\/ > 786 <\/a> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s55 dir=ltr> <\/td> <td class=s56> <\/td> <td class=s56> <\/td> <td class=s55> <\/td> <td class=s55> <\/td> <td class=s56 dir=ltr> kth + two pointers <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> <br\/><h2>Two Pointers\uff08\u53cc\u6307\u9488\uff09<\/h2><style nonce=H9\/S1\/fZHnmh64cVPjOTmg type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s70{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s65{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s68{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s73{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s66{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s69{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s67{border-bottom:1px SOLID #000000;border-bottom:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s64{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s71{border-bottom:1px SOLID #000000;background-color:#ffffff;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s72{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=136677845 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=136677845C0 style=width:29px> <\/th> <th class=header-shim id=136677845C1 style=width:208px> <\/th> <th class=header-shim id=136677845C2 style=width:59px> <\/th> <th class=header-shim id=136677845C3 style=width:50px> <\/th> <th class=header-shim id=136677845C4 style=width:50px> <\/th> <th class=header-shim id=136677845C5 style=width:50px> <\/th> <th class=header-shim id=136677845C6 style=width:50px> <\/th> <th class=header-shim id=136677845C7 style=width:50px> <\/th> <th class=header-shim id=136677845C8 style=width:50px> <\/th> <th class=header-shim id=136677845C9 style=width:50px> <\/th> <th class=header-shim id=136677845C10 style=width:70px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=136677845R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s64 dir=ltr> Id <\/td> <td class=s65 dir=ltr> Name <\/td> <td class=s66 dir=ltr> Difficulty <\/td> <td class=s66 colspan=7 dir=ltr> Similar Problems <\/td> <td class=s67 dir=ltr> <div class=softmerge-inner style=\"width: 168px; left: -1px;\"> Comments <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=136677845R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s64 dir=ltr> 11 <\/td> <td class=s68 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/two-pointers\/leetcode-11-container-with-most-water\/ > Container With Most Water <\/a> <\/td> <td class=s66 dir=ltr> \u2605\u2605 <\/td> <td class=s69 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-42-trapping-rain-water\/ > 42 <\/a> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64> <\/td> <td class=s64> <\/td> <td class=s64> <\/td> <td class=s64> <\/td> <td class=s64> <\/td> <td class=s65> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=136677845R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s64 dir=ltr> 125 <\/td> <td class=s70 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/two-pointers\/leetcode-209-minimum-size-subarray-sum\/ > Valid Palindrome <\/a> <\/td> <td class=s66 dir=ltr> \u2605\u2605 <\/td> <td class=s71 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/greedy\/leetcode-455-assign-cookies\/ > 455 <\/a> <\/td> <td class=s72> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s65> <\/td> <td class=s65> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=136677845R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s64 dir=ltr> 917 <\/td> <td class=s68 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/string\/leetcode-917-reverse-only-letters\/ > Reverse Only Letters <\/a> <\/td> <td class=s66 dir=ltr> \u2605\u2605 <\/td> <td class=s73 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/two-pointers\/leetcode-925-long-pressed-name\/ > 925 <\/a> <\/td> <td class=s73 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/geometry\/leetcode-986-interval-list-intersections\/ > 986 <\/a> <\/td> <td class=s73 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/greedy\/leetcode-885-boats-to-save-people\/ > 855 <\/a> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s65> <\/td> <td class=s65> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=136677845R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s64 dir=ltr> 167 <\/td> <td class=s68 dir=ltr> <div class=softmerge-inner style=\"width: 205px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/algorithms\/binary-search\/167-two-sum-ii-input-array-is-sorted\/ > Two Sum II &#8211; Input array is sorted <\/a> <\/div> <\/td> <td class=s66 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s73 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/two-pointers\/leetcode-15-3sum\/ > 15 <\/a> <\/td> <td class=s73 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/two-pointers\/leetcode-16-3sum-closest\/ > 16 <\/a> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s65> <\/td> <td class=s65> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=136677845R5 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 6 <\/div> <\/th> <td class=s64 dir=ltr> 977 <\/td> <td class=s68 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/squares-of-a-sorted-array> Squares of a Sorted Array <\/a> <\/td> <td class=s66 dir=ltr> \u2605\u2605 <\/td> <td class=s72> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64> <\/td> <td class=s64> <\/td> <td class=s64> <\/td> <td class=s67 dir=ltr> <div class=softmerge-inner style=\"width: 168px; left: -1px;\"> merge sort <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=136677845R6 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 7 <\/div> <\/th> <td class=s64 dir=ltr> 992 <\/td> <td class=s68 dir=ltr> <div class=softmerge-inner style=\"width: 205px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/two-pointers\/leetcode-992-subarrays-with-k-different-integers\/ > Subarrays with K Different Integers <\/a> <\/div> <\/td> <td class=s66 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64 dir=ltr> <\/td> <td class=s64> <\/td> <td class=s64> <\/td> <td class=s64> <\/td> <td class=s65 dir=ltr> <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> <br\/><h2>Advanced\uff08\u9ad8\u7ea7\uff09<\/h2><style nonce=RjaS60TpKOQbXhkRdxSpkA type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s79{border-bottom:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s80{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s75{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s77{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s76{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s81{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s82{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s78{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s74{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s83{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=126913158 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=126913158C0 style=width:29px> <\/th> <th class=header-shim id=126913158C1 style=width:172px> <\/th> <th class=header-shim id=126913158C2 style=width:56px> <\/th> <th class=header-shim id=126913158C3 style=width:50px> <\/th> <th class=header-shim id=126913158C4 style=width:50px> <\/th> <th class=header-shim id=126913158C5 style=width:50px> <\/th> <th class=header-shim id=126913158C6 style=width:50px> <\/th> <th class=header-shim id=126913158C7 style=width:50px> <\/th> <th class=header-shim id=126913158C8 style=width:50px> <\/th> <th class=header-shim id=126913158C9 style=width:124px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=126913158R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s74 dir=ltr> Id <\/td> <td class=s75 dir=ltr> Name <\/td> <td class=s76 dir=ltr> Difficulty <\/td> <td class=s76 colspan=6 dir=ltr> Similar Problems <\/td> <td class=s75 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=126913158R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s74 dir=ltr> 208 <\/td> <td class=s77 dir=ltr> <div class=softmerge-inner style=\"width: 169px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/data-structure\/leetcode-208-implement-trie-prefix-tree\/ > Implement Trie (Prefix Tree) <\/a> <\/div> <\/td> <td class=s76 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s78 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/string\/leetcode-648-replace-words\/ > 648 <\/a> <\/td> <td class=s79 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/hashtable\/leetcode-676-implement-magic-dictionary\/ > 676 <\/a> <\/td> <td class=s78 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-677-map-sum-pairs\/ > 677 <\/a> <\/td> <td class=s80 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/string\/leetcode-720-longest-word-in-dictionary\/ > 720 <\/a> <\/td> <td class=s81 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/tree\/leetcode-745-prefix-and-suffix-search\/ > 745 <\/a> <\/td> <td class=s82 dir=ltr> 211 <\/td> <td class=s75 dir=ltr> Trie <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=126913158R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s74 dir=ltr> 307 <\/td> <td class=s77 dir=ltr> <div class=softmerge-inner style=\"width: 169px; left: -1px;\"> <a href=https:\/\/zxi.mytechroad.com\/blog\/data-structure\/307-range-sum-query-mutable\/ > Range Sum Query &#8211; Mutable <\/a> <\/div> <\/td> <td class=s76 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s75 dir=ltr> BIT\/Segment Tree <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=126913158R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s74 dir=ltr> 901 <\/td> <td class=s77 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-901-online-stock-span\/ > Online Stock Span <\/a> <\/td> <td class=s76 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s78 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/stack\/leetcode-907-sum-of-subarray-minimums\/ > 907 <\/a> <\/td> <td class=s78 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/uncategorized\/leetcode-weekly-contest-130\/ > 1019 <\/a> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s83> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s75 dir=ltr> monotonic stack <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=126913158R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s74 dir=ltr> 239 <\/td> <td class=s77 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/heap\/leetcode-239-sliding-window-maximum\/ > Sliding Window Maximum <\/a> <\/td> <td class=s76 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s74 dir=ltr> <\/td> <td class=s75 dir=ltr> monotonic queue <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> \n<!-- in page -->\n<ins class=\"adsbygoogle\"\n     style=\"display:block\"\n     data-ad-client=\"ca-pub-2404451723245401\"\n     data-ad-slot=\"4108005821\"\n     data-ad-format=\"auto\"\n     data-full-width-responsive=\"true\"><\/ins>\n<br\/><h2>DP\uff08\u52a8\u6001\u89c4\u5212\uff09<\/h2><style nonce=+8C5+cowjFKyBz9r\/Q2uSg type=text\/css>\n html {  }\n        #sheets-viewport { overflow: auto; }\n        #sheets-viewport.widget-viewport { overflow: hidden; }\n        .grid-container {  background: white;}\n        .grid-table-container {  }\n        #top-bar {\n          background: url(\"\/\/ssl.gstatic.com\/docs\/spreadsheets\/publishheader.png\") repeat-x bottom;\n          margin: 0;\n          overflow: hidden;\n        }\n        #top-bar {\n          border-bottom: 1px solid #ccc;\n          padding: 6px 6px 0;\n        }\n        #doc-title { padding-bottom: 5px; }\n        #doc-title .name { font-size: 15px; }\n        #sheet-menu {\n          font-size: 13px;\n          margin: 6px 0 0;\n          padding: 0 0 5px;\n        }\n        #sheet-menu li {\n          display: inline;\n          list-style-type: none;\n          margin: 0;\n          padding: 5px 8px;\n        }\n        #sheet-menu li.active {\n          background-color: #fff;\n          font-weight: bold;\n          border: 1px solid #999;\n        }\n        #top-bar #sheet-menu li.active {\n          border-bottom: 0;\n        }\n        #sheet-menu a, #sheet-menu a:visited { color: #07c; }\n        #footer {\n          background: #f0f0f0;\n          border-top: 1px #ccc solid;\n          border-bottom: 1px #ccc solid;\n          font-size: 13;\n          padding: 10px 10px;\n        }\n        .dash {\n          padding: 0 6px;\n        }\n        .ritz .waffle a { color: inherit; }.ritz .waffle .s90{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:middle;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s86{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s97{border-bottom:1px SOLID #000000;border-bottom:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s92{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:middle;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s84{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:right;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s96{border-bottom:1px SOLID #000000;border-bottom:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:middle;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s98{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;}.ritz .waffle .s89{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#d9ead3;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s87{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s85{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s94{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:center;color:#000000;font-family:'Arial';font-size:10pt;vertical-align:middle;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s93{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:middle;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s95{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#f4cccc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s91{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#fff2cc;text-align:right;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:nowrap;direction:ltr;padding:2px 3px 2px 3px;}.ritz .waffle .s88{border-bottom:1px SOLID #000000;border-right:1px SOLID #000000;background-color:#ffffff;text-align:left;text-decoration:underline;-webkit-text-decoration-skip:none;text-decoration-skip-ink:none;color:#1155cc;font-family:'Arial';font-size:10pt;vertical-align:bottom;white-space:normal;overflow:hidden;word-wrap:break-word;direction:ltr;padding:2px 3px 2px 3px;}\n<\/style> <div id=sheets-viewport> <div dir=ltr id=1674276502 style> <div class=\"ritz grid-container\" dir=ltr> <table cellpadding=0 cellspacing=0 class=waffle> <thead> <tr> <th class=\"row-header freezebar-origin-ltr header-shim row-header-shim\"> <\/th> <th class=header-shim id=1674276502C0 style=width:36px> <\/th> <th class=header-shim id=1674276502C1 style=width:187px> <\/th> <th class=header-shim id=1674276502C2 style=width:72px> <\/th> <th class=header-shim id=1674276502C3 style=width:50px> <\/th> <th class=header-shim id=1674276502C4 style=width:50px> <\/th> <th class=header-shim id=1674276502C5 style=width:50px> <\/th> <th class=header-shim id=1674276502C6 style=width:50px> <\/th> <th class=header-shim id=1674276502C7 style=width:50px> <\/th> <th class=header-shim id=1674276502C8 style=width:197px> <\/th> <\/tr> <\/thead> <tbody> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R0 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 1 <\/div> <\/th> <td class=s84 dir=ltr> Id <\/td> <td class=s85 dir=ltr> Name <\/td> <td class=s86 dir=ltr> Difficulty <\/td> <td class=s86 colspan=5 dir=ltr> Similar Problems <\/td> <td class=s87 dir=ltr> Comments <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R1 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 2 <\/div> <\/th> <td class=s84 dir=ltr> 70 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-70-climbing-stairs\/ > Climbing Stairs <\/a> <\/td> <td class=s86 dir=ltr> \u2605 <\/td> <td class=s89 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-746-min-cost-climbing-stairs\/ > 746 <\/a> <\/td> <td class=s89 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1137-n-th-tribonacci-number\/ > 1137 <\/a> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s90 dir=ltr rowspan=3> I: O(n), S = O(n), T = O(n) <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R2 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 3 <\/div> <\/th> <td class=s84 dir=ltr> 303 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-303-range-sum-query-immutable\/ > Range Sum Query &#8211; Immutable <\/a> <\/td> <td class=s86 dir=ltr> \u2605 <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1218-longest-arithmetic-subsequence-of-given-difference\/ > 1218 <\/a> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R3 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 4 <\/div> <\/th> <td class=s84 dir=ltr> 53 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-53-maximum-subarray\/ > Maximum Subarray <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605 <\/td> <td class=s89 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-121-best-time-to-buy-and-sell-stock\/ > 121 <\/a> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R4 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 5 <\/div> <\/th> <td class=s92 dir=ltr rowspan=2> 62 <\/td> <td class=s93 dir=ltr rowspan=2> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-62-unique-paths\/ > Unique Paths <\/a> <\/td> <td class=s94 dir=ltr rowspan=2> \u2605\u2605 <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-63-unique-paths-ii\/ > 63 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-64-minimum-path-sum\/ > 64 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-120-triangle\/ > 120 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-174-dungeon-game\/ > 174 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-931-minimum-falling-path-sum\/ > 931 <\/a> <\/td> <td class=s90 dir=ltr rowspan=3> I: O(mn), S = O(mn), T = O(mn) <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R5 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 6 <\/div> <\/th> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-1210-minimum-moves-to-reach-target-with-rotations\/ > 1210 <\/a> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R6 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 7 <\/div> <\/th> <td class=s84 dir=ltr> 85 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-85-maximal-rectangle\/ > Maximal Rectangle <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-304-range-sum-query-2d-immutable\/ > 221 <\/a> <\/td> <td class=s89 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/range-sum-query-2d-immutable> 304 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1277-count-square-submatrices-with-all-ones\/ > 1277 <\/a> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R7 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 8 <\/div> <\/th> <td class=s84 dir=ltr> 198 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-198-house-robber\/ > House Robber <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s91 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/house-robber-ii\/ > 213 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-309-best-time-to-buy-and-sell-stock-with-cooldown\/ > 309 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-740-delete-and-earn\/ > 740 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-790-domino-and-tromino-tiling\/ > 790 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-801-minimum-swaps-to-make-sequences-increasing\/ > 801 <\/a> <\/td> <td class=s87 dir=ltr> I: O(n), S = O(3n), T = O(3n) <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R8 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 9 <\/div> <\/th> <td class=s84 dir=ltr> 279 <\/td> <td class=s88> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-279-perfect-squares\/ > Perfect Squares <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s87> <\/td> <td class=s87> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s87 dir=ltr> I: n, S = O(n), T = O(n*sqrt(n)) <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R9 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 10 <\/div> <\/th> <td class=s84 dir=ltr> 139 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-139-word-break\/ > Word Break <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-140-word-break-ii\/ > 140 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-818-race-car\/ > 818 <\/a> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s90 dir=ltr rowspan=3> I: O(n), S = O(n), T = O(n^2) <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R10 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 11 <\/div> <\/th> <td class=s84 dir=ltr> 300 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-300-longest-increasing-subsequence\/ > Longest Increasing Subsequence <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-673-number-of-longest-increasing-subsequence\/ > 673 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-weekly-contest-137\/ > 1048 <\/a> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R11 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 12 <\/div> <\/th> <td class=s84 dir=ltr> 96 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-96-unique-binary-search-trees\/ > Unique Binary Search Trees <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R12 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 13 <\/div> <\/th> <td class=s84 dir=ltr> 1105 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1105-filling-bookcase-shelves\/ > Filling Bookcase Shelves <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s96 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(n) + t, S = O(n), T = O(n^2) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R13 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 14 <\/div> <\/th> <td class=s84 dir=ltr> 131 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-131-palindrome-partitioning\/ > Palindrome Partitioning <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-89-gray-code\/ > 89 <\/a> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s97 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(n), S = O(2^n), T = O(2^n) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R14 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 15 <\/div> <\/th> <td class=s92 dir=ltr rowspan=2> 72 <\/td> <td class=s93 dir=ltr rowspan=2> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-72-edit-distance\/ > Edit Distance <\/a> <\/td> <td class=s94 dir=ltr rowspan=2> \u2605\u2605\u2605 <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-10-regular-expression-matching\/ > 10 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/wildcard-matching\/ > 44 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-97-interleaving-string\/ > 97 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-115-distinct-subsequences\/ > 115 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/delete-operation-for-two-strings\/ > 583 <\/a> <\/td> <td class=s90 dir=ltr rowspan=2> I: O(m+n), S = O(mn), T = O(mn) <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R15 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 16 <\/div> <\/th> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-712-minimum-ascii-delete-sum-for-two-strings\/ > 712 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1187-make-array-strictly-increasing\/ > 1187 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1143-longest-common-subsequence\/ > 1143 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1092-shortest-common-supersequence\/ > 1092 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-718-maximum-length-of-repeated-subarray\/ > 718 <\/a> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R16 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 17 <\/div> <\/th> <td class=s84 dir=ltr> 1139 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1139-largest-1-bordered-square\/ > Largest 1-Bordered Square <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s96 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(mn), S = O(mn) <br> T = O(mn*min(n,m)) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R17 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 18 <\/div> <\/th> <td class=s84 dir=ltr> 688 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/knight-probability-in-chessboard\/ > Knight Probability in Chessboard <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605 <\/td> <td class=s91 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/out-of-boundary-paths\/ > 576 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/leetcode.com\/problems\/knight-dialer\/ > 935 <\/a> <\/td> <td class=s84 dir=ltr> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s97 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(mn) + k <br> S = O(kmn), T = O(kmn) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R18 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 19 <\/div> <\/th> <td class=s92 dir=ltr rowspan=2> 322 <\/td> <td class=s93 dir=ltr rowspan=2> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-322-coin-change\/ > Coin Change <\/a> <\/td> <td class=s94 dir=ltr rowspan=2> \u2605\u2605\u2605 <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-377-combination-sum-iv\/ > 377 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-416-partition-equal-subset-sum\/ > 416 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-494-target-sum\/ > 494 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1043-partition-array-for-maximum-sum\/ > 1043 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-weekly-contest-137\/ > 1049 <\/a> <\/td> <td class=s90 dir=ltr rowspan=2> I: O(n) + k, S = O(n), T = O(kn) <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R19 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 20 <\/div> <\/th> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1220-count-vowels-permutation\/ > 1220 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1230-toss-strange-coins\/ > 1230 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1262-greatest-sum-divisible-by-three\/ > 1262 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1269-number-of-ways-to-stay-in-the-same-place-after-some-steps\/ > 1269 <\/a> <\/td> <td class=s84 dir=ltr> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R20 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 21 <\/div> <\/th> <td class=s84 dir=ltr> 813 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-813-largest-sum-of-averages\/ > Largest Sum of Averages <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1278-palindrome-partitioning-iii\/ > 1278 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1335-minimum-difficulty-of-a-job-schedule\/ > 1335 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-410-split-array-largest-sum\/ > 410 <\/a> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s97 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(n) + k <br> S = O(n*k), T = O(kn^2) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R21 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 22 <\/div> <\/th> <td class=s84 dir=ltr> 1223 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1223-dice-roll-simulation\/ > Dice Roll Simulation <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s98> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s97 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(n) + k + p <br> S = O(k*p), T = O(n^2kp) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R22 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 23 <\/div> <\/th> <td class=s84 dir=ltr> 312 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-312-burst-balloons\/ > Burst Balloons <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-664-strange-printer\/ > 664 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-weekly-contest-131-1021-1022-1023-1024\/ > 1024 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/leetcode\/leetcode-weekly-contest-135-1037-1038-1039-1040\/ > 1039 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/recursion\/leetcode-1140-stone-game-ii\/ > 1140 <\/a> <\/td> <td class=s91 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/1130-minimum-cost-tree-from-leaf-values\/ > 1130 <\/a> <\/td> <td class=s97 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(n), S = O(n^2), T = O(n^3) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R23 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 24 <\/div> <\/th> <td class=s84 dir=ltr> 741 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-741-cherry-pickup\/ > Cherry Pickup <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605\u2605 <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s97 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(n^2), S = O(n^3), T = O(n^3) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R24 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 25 <\/div> <\/th> <td class=s84 dir=ltr> 546 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-546-remove-boxes\/ > Remove Boxes <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605\u2605\u2605 <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s97 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(n), S = O(n^3), T = O(n^4) <\/div> <\/td> <\/tr> <tr style=height:20px;> <th class=\"row-headers-background row-header-shim\" id=1674276502R25 style=\"height: 20px;\"> <div class=row-header-wrapper style=\"line-height: 20px;\"> 26 <\/div> <\/th> <td class=s84 dir=ltr> 943 <\/td> <td class=s88 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-943-find-the-shortest-superstring\/ > Find the Shortest Superstring <\/a> <\/td> <td class=s86 dir=ltr> \u2605\u2605\u2605\u2605\u2605 <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-980-unique-paths-iii\/ > 980 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/searching\/leetcode-996-number-of-squareful-arrays\/ > 996 <\/a> <\/td> <td class=s95 dir=ltr> <a href=https:\/\/zxi.mytechroad.com\/blog\/dynamic-programming\/leetcode-1125-smallest-sufficient-team\/ > 1125 <\/a> <\/td> <td class=s84> <\/td> <td class=s84> <\/td> <td class=s97 dir=ltr> <div class=softmerge-inner style=\"width: 295px; left: -1px;\"> I: O(n) <br> S = O(n*2^n), T = (n^2*2^n) <\/div> <\/td> <\/tr> <\/tbody> <\/table> <\/div> <\/div> <\/div> \n\n\n\n<style>\n.row-header-shim { display: none; }\ntd, th {font-size: 10px; padding: 0.05em; }\n<\/style>\n\n\n\n<img decoding=\"async\" src=\"https:\/\/hitwebcounter.com\/counter\/counter.php?page=7189028&#038;style=0024&#038;nbdigits=5&#038;type=page&#038;initCount=0\" title=\"Free-Counter\" Alt=\"hitwebcounter\" border=\"0\" >\n","protected":false},"excerpt":{"rendered":"<p>Data source: link suggestions and comments are welcome\uff08\u9700\u8981\u79d1\u5b66\u4e0a\u7f51\uff09 Tree\uff08\u6811\uff09 1 Id Name Difficulty Similar Problems Comments 2 94 Binary Tree Inorder Traversal \u2605 144 145&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-6187","page","type-page","status-publish","hentry","entry","simple"],"_links":{"self":[{"href":"https:\/\/zxi.mytechroad.com\/blog\/wp-json\/wp\/v2\/pages\/6187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zxi.mytechroad.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/zxi.mytechroad.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/zxi.mytechroad.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zxi.mytechroad.com\/blog\/wp-json\/wp\/v2\/comments?post=6187"}],"version-history":[{"count":33,"href":"https:\/\/zxi.mytechroad.com\/blog\/wp-json\/wp\/v2\/pages\/6187\/revisions"}],"predecessor-version":[{"id":6260,"href":"https:\/\/zxi.mytechroad.com\/blog\/wp-json\/wp\/v2\/pages\/6187\/revisions\/6260"}],"wp:attachment":[{"href":"https:\/\/zxi.mytechroad.com\/blog\/wp-json\/wp\/v2\/media?parent=6187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}