1 2 3 4 5 6 7 8 9 | static auto x = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }(); class Solution { public: bool canReorderDoubled([......]<p class="read-more"><a href="https://www.gerrytang.top/?p=310">Read more</a></p> |
LeetCode 565. Array Nesting
1 2 3 4 5 6 7 8 | int arrayNesting(int* nums, int numsSize) { int max=INT_MIN; for(int i=0;imax)max=nowCount; } } return max; } |
[……]
LeetCode 441. Arranging Coins
1 2 3 4 | int arrangeCoins(int n) { long N=n; return (-1+sqrt(1+8*N))/2; } |
(adsbygoogle = window.adsbygoogle || []).push({});[……]
LeetCode 704. Binary Search
1 2 3 4 5 6 7 8 9 | static auto x = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }(); class Solution { public: int search(vector& nums[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=304">Read more</a></p> |
LeetCode 816. Ambiguous Coordinates
1 2 3 4 5 6 7 8 9 | static auto x = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }(); class Solution { private: inline vector sub(stri[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=302">Read more</a></p> |
LeetCode 894. All Possible Full Binary Trees
1 2 3 4 5 6 7 8 9 | static auto x = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }(); /** * Definition for a binary tree node. * struct[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=300">Read more</a></p> |
LeetCode 797. All Paths From Source to Target
1 2 3 4 5 6 7 8 9 | static auto x = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }(); class Solution { public: vector allPathsSourceTa[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=298">Read more</a></p> |
LeetCode 432. All O`one Data Structure
1 2 3 4 5 6 7 8 9 10 11 | static auto x = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }(); class Node{ public: string key; int cou[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=296">Read more</a></p> |
LeetCode 863. All Nodes Distance K in Binary Tree
1 2 3 4 5 6 7 8 9 | static auto x = []() { ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }(); /** * Definition for a binary tree node. * struct[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=294">Read more</a></p> |
LeetCode 306. Additive Number
1 2 3 4 5 6 7 | long get(char* num,int len){ long ret=0; for(int i=0;i=0;i--){ if(num[i]-'0'==t%10){ t/=10; } else[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=292">Read more</a></p> |