1 2 3 4 5 6 7 | /** * Definition for a binary tree node. * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; *[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=569">Read more</a></p> |
LeetCode 179. Largest Number
LeetCode 985. Sum of Even Numbers After Queries
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 sumEven[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=564">Read more</a></p> |
LeetCode 1051. Height Checker
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 heightChec[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=562">Read more</a></p> |
LeetCode 414. Third Maximum Number
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 thirdMax(v[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=560">Read more</a></p> |
using pymongo to change the timestamp into datetime in mongoDB Atlas
In an assignment in the USYD, I have to update all the records in a collection as I want the timestamp in the format of ISODate, while it is timestamp[……]
LeetCode 912. Sort an Array
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 sortArr[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=555">Read more</a></p> |
LeetCode 151. Reverse Words in a String
1 2 3 4 5 6 7 8 | class Solution(object): def reverseWords(self, s): """ :type s: str :rtype: str """ arr=[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=553">Read more</a></p> |
LeetCode 468. Validate IP Address
1 2 3 4 | import re class Solution(object): def validIPAddress(self, IP): if re.match('^((25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|[0-9])\.){3}(25[0-5]|[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=551">Read more</a></p> |
LeetCode 934. Shortest Bridge
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 bool i[......]<p class="read-more"><a href="https://www.gerrytang.top/?p=548">Read more</a></p> |