Leetcode $$
OString2024
个人公众号:OString2024
zhihu:Ostring
展开
-
[LeetCode] 170.Two Sum III - Data structure design
Design and implement a TwoSum class. It should support the following operations:add and find. add - Add the number to an internal data structure. find - Find if there exists any pair of numbers which ...原创 2020-02-05 11:23:23 · 125 阅读 · 0 评论 -
[LeetCode] 159. Longest Substring with At Most Two Distinct Characters
Given a string s , find the length of the longest substring t that contains at most 2 distinct characters. Example 1: Input: “eceba” Output: 3 Explanation: tis “ece” which its length is 3. Example 2:...原创 2020-02-04 17:19:32 · 143 阅读 · 0 评论 -
[LeetCode] 152. Binary Tree Upside Down 二叉树的上下颠倒
Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it upside down and turn it into a tree where the origin...原创 2020-02-04 16:23:33 · 269 阅读 · 0 评论