随笔分类 - DFS
摘要:[抄题]: Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string ma
阅读全文
摘要:[抄题]: 求挖掉一些区域后,能允许出现的最大十字架 In a 2D grid from (0, 0) to (N-1, N-1), every cell contains a 1, except those cells in the given list mines which are 0. Wh
阅读全文
摘要:[抄题]: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should ch
阅读全文
摘要:[抄题]: Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer t
阅读全文
摘要:[抄题]: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where
阅读全文
摘要:[抄题]: Given a set of distinct integers, nums, return all possible subsets (the power set). Note: The solution set must not contain duplicate subsets.
阅读全文
摘要:[抄题]: 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 coordinate
阅读全文
摘要:[抄题]: You are given a data structure of employee information, which includes the employee's unique id, his importance value and his directsubordinates
阅读全文
摘要:[抄题]: 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 lis
阅读全文
摘要:[抄题]: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tre
阅读全文
摘要:[抄题]: 求最多的联通的1的数量 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 (horizonta
阅读全文
摘要:[抄题]: Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: [暴力解法]: 时间分析: 空间分析
阅读全文
摘要:[抄题]: 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 given
阅读全文
摘要:[抄题]: Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally
阅读全文

浙公网安备 33010602011771号