摘要:
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
摘要:
Given a robot cleaner in a room modeled as a grid. Each cell in the grid can be empty or blocked. The robot cleaner with 4 given APIs can move forward 阅读全文
摘要:
Given the root of a binary tree, each node in the tree has a distinct value. After deleting all nodes with a value in to_delete, we are left with a fo 阅读全文
摘要:
Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Each element is either an integer, or a list -- w 阅读全文
摘要:
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to le 阅读全文
摘要:
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example:Given binary tree [3 阅读全文
摘要:
Example 1: Example 2: Note: 典型的DFS,跟之前的一个手机键盘拨号很像 BFS Solution: 更短的DFS解法,加上一个path代表遍历的路径(classic dfs),最后对比路径的长度与房间的总数: 更短的BFS: 阅读全文
摘要:
题目描述: Consider all the leaves of a binary tree. From left to right order, the values of those leaves form a leaf value sequence. For example, in the g 阅读全文