上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页
摘要: 1 """ 2 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 connecting 阅读全文
posted @ 2020-02-15 22:40 yawenw 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, and each room may have some keys to access th 阅读全文
posted @ 2020-02-15 22:39 yawenw 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 3 For example, given n = 3, a solution 阅读全文
posted @ 2020-02-15 10:52 yawenw 阅读(106) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. 3 The distance between two adjacent cells is 1. 4 Exampl 阅读全文
posted @ 2020-02-15 10:48 yawenw 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree, return the inorder traversal of its nodes' values. 3 Example: 4 Input: [1,null,2,3] 5 1 6 \ 7 2 8 / 9 3 10 Output: [1,3,2 阅读全文
posted @ 2020-02-13 22:20 yawenw 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 We are given the head node root of a binary tree, where additionally every node's value is either a 0 or a 1. 3 Return the same tree where eve 阅读全文
posted @ 2020-02-13 22:17 yawenw 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the give 阅读全文
posted @ 2020-02-13 22:15 yawenw 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. 3 An example is the root-to-leaf path 1- 阅读全文
posted @ 2020-02-13 22:13 yawenw 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. 3 According to the definition of LCA on Wikipedia: 阅读全文
posted @ 2020-02-13 22:12 yawenw 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 1 """ 2 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were insert 阅读全文
posted @ 2020-02-12 22:34 yawenw 阅读(119) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页