随笔分类 - LeetCode
摘要:题目: 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 "a
阅读全文
摘要:题目: Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: Construct the maximum tree by the given arr
阅读全文
摘要:题目: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You m
阅读全文
摘要:题目: Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly two or zero sub-no
阅读全文
摘要:题目: 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 tre
阅读全文
摘要:题目: Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators
阅读全文
摘要:题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. Exam
阅读全文
摘要:题目: Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the
阅读全文
摘要:题目: 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 i
阅读全文
摘要:题目: Given a non-empty string s and a dictionary wordDict containing a list of non-emptywords, determine if s can be segmented into a space-separated s
阅读全文
摘要:题目: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example:
阅读全文
摘要:题目: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. For example, given th
阅读全文
摘要:题目: 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 children. Ex
阅读全文
摘要:题目: 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 su
阅读全文
摘要:题目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can yo
阅读全文
摘要:题目: Given a linked list, determine if it has a cycle in it. To represent a cycle in the given linked list, we use an integer pos which represents the
阅读全文
摘要:题目: You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be
阅读全文
摘要:题目: Given a non-negative integer c, your task is to decide whether there're two integers a and b such that a2 + b2 = c. Example 1: Example 2: 分析: 给定一个
阅读全文
摘要:题目: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others a
阅读全文
摘要:题目: Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: 分析: 给定一个数组,返回其中三个元素乘积的最大
阅读全文

浙公网安备 33010602011771号