辞职考研上岸北大软微 我从18年辞职考研。第一年考浙大计科361分,因一心想去计科,放弃工程师学院和软件学院的调剂面试。第二年考浙大计科402分,面试被刷。第三年考北大软微397分,成功上岸。之后有时间会补充下细节。...
778-Swim in Rising Water DescriptionOn an N x N grid, each square grid[i][j] represents the elevation at that point (i,j).Now rain starts to fall. At time t, the depth of the water everywhere is t. You can swim from a squ...
130-Surrounded Regions DescriptionGiven a 2D board containing ‘X’ and ‘O’ (the letter O), capture all regions surrounded by ‘X’.A region is captured by flipping all ‘O’s into ‘X’s in that surrounded region.Example:...
133-Clone Graph DescriptionClone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ’s undirected graph serialization: Nodes are labeled uniquely.We use # as a separator...
332-Reconstruct Itinerary DescriptionGiven a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tickets belong to a man who departs from ...
210-Course Schedule II DescriptionThere are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expres...
542-01 Matrix DescriptionGiven a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.The distance between two adjacent cells is 1.Example 1: Input:0 0 00 1 00 0 0Output:...
721-Accounts Merge DescriptionGiven a list accounts, each element accounts[i] is a list of strings, where the first element accounts[i][0] is a name, and the rest of the elements are emails representing emails of the ...
417-Pacific Atlantic Water Flow DescriptionGiven an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the “Pacific ocean” touches the left and top edges of the matrix and the “Atlantic...
473-Matchsticks to Square DescriptionRemember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one square by using up all those matchstic...
200-Number of Islands DescriptionGiven a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. Y...
802-Find Eventual Safe States DescriptionIn a directed graph, we start at some node and every turn, walk along a directed edge of the graph. If we reach a node that is terminal (that is, it has no outgoing directed edges), we s...
785-Is Graph Bipartite? DescriptionGiven an undirected graph, return true if and only if it is bipartite.Recall that a graph is bipartite if we can split it’s set of nodes into two independent subsets A and B such that e...
491-Increasing Subsequences DescriptionGiven an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing subsequence should be at least 2 .E...
547-Friend Circles DescriptionThere are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct frien...
529-Minesweeper DescriptionLet’s play the minesweeper game (Wikipedia, online game)!You are given a 2D char matrix representing the game board. ‘M’ represents an unrevealed mine, ‘E’ represents an unrevealed empt...
733-Flood Fill DescriptionAn image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).Given a coordinate (sr, sc) representing the starting pixel ...
145-Binary Tree Postorder Traversal DescriptionGiven a binary tree, return the postorder traversal of its nodes’ values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [3,2,1]Follow up: Recursive solution is ...
98-Validate Binary Search Tree DescriptionGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only nodes with keys less than the nod...
236-Lowest Common Ancestor of a Binary Tree DescriptionGiven a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between...