摘要: 2. Add Two Numbers - Medium topics: linked list, math solution 3. Longest Substring Without Repeating Characters - Medium topics: hash table, two poin 阅读全文
posted @ 2019-06-26 09:10 fatttcat 阅读(280) 评论(0) 推荐(0) 编辑
摘要: Sliding Window Problems 76. Minimum Window Substring 438. Find All Anagrams in a String 30. Substring with Concatenation of All Words 3. Longest Subst 阅读全文
posted @ 2019-02-09 18:32 fatttcat 阅读(125) 评论(0) 推荐(0) 编辑
摘要: sort & comparator 各种排序方法总结 bit manipulation A summary: how to use bit manipulation to solve problems 阅读全文
posted @ 2018-12-19 14:57 fatttcat 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, find the maximum value V for which there exist different nodes A and B where V = |A.val - B.val| and A is an ancestor 阅读全文
posted @ 2020-11-11 17:11 fatttcat 阅读(116) 评论(0) 推荐(0) 编辑
摘要: ... M1: sort + two pointersPush from the two ends and attempt to find any addition of the two elements < K;if the addition >= K, then decrease the hig 阅读全文
posted @ 2020-11-11 17:06 fatttcat 阅读(117) 评论(0) 推荐(0) 编辑
摘要: A tree is an undirected graph in which any two vertices are connected by exactly one path. In other words, any connected graph without simple cycles i 阅读全文
posted @ 2020-11-11 16:59 fatttcat 阅读(143) 评论(0) 推荐(0) 编辑
摘要: ... M1: time = O(nlogn), space = O(logn) for sorting class Solution { public boolean canAttendMeetings(int[][] intervals) { Arrays.sort(intervals, (a, 阅读全文
posted @ 2020-11-11 16:52 fatttcat 阅读(80) 评论(0) 推荐(0) 编辑
摘要: You are given the root of a binary search tree (BST), where exactly two nodes of the tree were swapped by mistake. Recover the tree without changing i 阅读全文
posted @ 2020-11-11 16:48 fatttcat 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given an integer array nums, return the number of longest increasing subsequences. Notice that the sequence has to be strictly increasing. Example 1: 阅读全文
posted @ 2020-11-11 16:43 fatttcat 阅读(106) 评论(0) 推荐(0) 编辑
摘要: You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that th 阅读全文
posted @ 2020-11-11 16:41 fatttcat 阅读(184) 评论(0) 推荐(0) 编辑
摘要: You are given a sorted unique integer array nums. Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, 阅读全文
posted @ 2020-10-29 14:18 fatttcat 阅读(90) 评论(0) 推荐(0) 编辑
摘要: Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k] such that i < j < k and nums[i] < num 阅读全文
posted @ 2020-10-29 14:13 fatttcat 阅读(120) 评论(0) 推荐(0) 编辑
摘要: We are given an array asteroids of integers representing asteroids in a row. For each asteroid, the absolute value represents its size, and the sign r 阅读全文
posted @ 2020-10-29 13:49 fatttcat 阅读(85) 评论(0) 推荐(0) 编辑