摘要:
2. Add Two Numbers - Medium topics: linked list, math solution 3. Longest Substring Without Repeating Characters - Medium topics: hash table, two poin 阅读全文
摘要:
Sliding Window Problems 76. Minimum Window Substring 438. Find All Anagrams in a String 30. Substring with Concatenation of All Words 3. Longest Subst 阅读全文
摘要:
sort & comparator 各种排序方法总结 bit manipulation A summary: how to use bit manipulation to solve problems 阅读全文
摘要:
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 阅读全文
摘要:
... 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 阅读全文
摘要:
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 阅读全文
摘要:
... M1: time = O(nlogn), space = O(logn) for sorting class Solution { public boolean canAttendMeetings(int[][] intervals) { Arrays.sort(intervals, (a, 阅读全文
摘要:
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 阅读全文
摘要:
Given an integer array nums, return the number of longest increasing subsequences. Notice that the sequence has to be strictly increasing. Example 1: 阅读全文
摘要:
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 阅读全文
摘要:
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, 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文