自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

MayUWell

Learn, Sleep, Learn

原创 做了的事和计划做的一些事

书籍: <机器学习实战> 已看完,GitHub代码已完成(书中代码是python2,我的是python3)。强烈推荐此书 链接:https://github.com/hyc2017/MachineLearningInAction <集体智慧编程&a...

2018-01-29 14:18:00 1090 33

原创 778-Swim in Rising Water

Description On 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...

2018-06-06 21:46:17 317 1

原创 130-Surrounded Regions

Description Given a 2D board containing ‘X’ and ‘O’ (the letter O), capture all regions surrounded by ‘X’. A region is captured by flipping all ‘O’...

2018-06-05 21:30:50 182 0

原创 133-Clone Graph

Description Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ’s undirected graph serialization: N...

2018-06-05 17:48:14 194 0

原创 332-Reconstruct Itinerary

Description Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. A...

2018-05-31 15:56:46 198 0

原创 210-Course Schedule II

Description There 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...

2018-05-31 14:54:46 245 0

原创 542-01 Matrix

Description Given 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. ...

2018-05-30 16:03:58 195 0

原创 721-Accounts Merge

Description Given 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 ...

2018-05-30 14:56:57 222 0

原创 417-Pacific Atlantic Water Flow

Description Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the “Pacific ocean” touches the...

2018-05-30 13:35:09 147 0

原创 473-Matchsticks to Square

Description Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you ...

2018-05-28 23:14:04 155 0

原创 200-Number of Islands

Description Given 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 conn...

2018-05-28 22:55:00 114 0

原创 802-Find Eventual Safe States

Description In 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...

2018-05-28 22:49:27 144 0

原创 785-Is Graph Bipartite?

Description Given 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 nod...

2018-05-28 22:19:47 255 0

原创 491-Increasing Subsequences

Description Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an...

2018-05-28 21:55:25 117 0

原创 547-Friend Circles

Description There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if...

2018-05-28 17:47:06 116 0

原创 529-Minesweeper

Description Let’s play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representing the game board. ‘M’ represents an...

2018-05-28 17:01:56 161 0

原创 733-Flood Fill

Description An 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 c...

2018-05-28 16:09:44 200 0

原创 145-Binary Tree Postorder Traversal

Description Given a binary tree, return the postorder traversal of its nodes’ values. Example: Input: [1,null,2,3] 1 \ 2 / 3 ...

2018-05-28 15:57:06 104 0

原创 98-Validate Binary Search Tree

Description Given 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 n...

2018-05-25 14:59:26 144 0

原创 236-Lowest Common Ancestor of a Binary Tree

Description Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipe...

2018-05-25 14:45:47 141 0

原创 117-Populating Next Right Pointers in Each Node II

Description Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next po...

2018-05-25 14:18:27 113 0

原创 113-Path Sum II

Description Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. Note: A leaf is a node with no c...

2018-05-25 13:51:08 96 0

原创 116-Populating Next Right Pointers in Each Node

Description Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next po...

2018-05-25 11:25:54 75 0

原创 114-Flatten Binary Tree to Linked List

Description Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / \ \ 3 ...

2018-05-25 11:10:14 75 0

原创 652-Find Duplicate Subtrees

Description Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only need to return the root node of any on...

2018-05-25 10:45:06 85 0

原创 450-Delete Node in a BST

Description Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly ...

2018-05-25 10:28:03 74 0

原创 129-Sum Root to Leaf Numbers

Description Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf pa...

2018-05-25 10:06:52 75 0

原创 662-Maximum Width of Binary Tree

Description Given a binary tree, write a function to get the maximum width of the given tree. The width of a tree is the maximum width among all lev...

2018-05-25 09:47:43 124 0

原创 199-Binary Tree Right Side View

Description Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to b...

2018-05-06 19:41:46 115 0

原创 102-Binary Tree Level Order Traversal

Description Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level). For example: G...

2018-05-06 19:35:18 95 0

原创 449-Serialize and Deserialize BST

Description Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memo...

2018-05-06 19:29:26 135 0

原创 684-Redundant Connection

Description In this problem, a tree is an undirected graph that is connected and has no cycles. The given input is a graph that started as a tree w...

2018-05-06 19:00:03 142 0

原创 337-House Robber III

Description The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the “root.” Besides the ...

2018-05-06 18:35:52 122 0

原创 623-Add One Row to Tree

Description Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root no...

2018-05-03 20:16:31 74 0

原创 655-Print Binary Tree

Description Print a binary tree in an m*n 2D string array following these rules: The row number m should be equal to the height of the given binar...

2018-05-03 20:08:58 132 0

原创 508-Most Frequent Subtree Sum

Description Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all th...

2018-05-03 20:00:29 65 0

原创 515-Find Largest Value in Each Tree Row

Description You need to find the largest value in each row of a binary tree. Example: Input: 1 / \ 3 2 /...

2018-05-03 19:49:38 87 0

原创 513-Find Bottom Left Tree Value

Description Given a binary tree, find the leftmost value in the last row of the tree. Example 1: Input: 2 / \ 1 3 Output: 1 Ex...

2018-05-03 19:46:18 74 0

原创 654-Maximum Binary Tree

Description Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number ...

2018-05-03 19:41:38 75 0

原创 814-Binary Tree Pruning

Description We are given the head node root of a binary tree, where additionally every node’s value is either a 0 or a 1. Return the same tree wher...

2018-05-03 19:32:21 73 0

提示
确定要删除当前文章?
取消 删除