随笔分类 -  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 阅读全文
posted @ 2019-07-03 18:07 silentteller 阅读(737) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-23 00:04 silentteller 阅读(258) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-22 00:35 silentteller 阅读(206) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-22 00:25 silentteller 阅读(276) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-20 23:52 silentteller 阅读(210) 评论(0) 推荐(0)
摘要:题目: Given a string of numbers and operators, return all possible results from computing all the different possible ways to group numbers and operators 阅读全文
posted @ 2019-05-20 23:31 silentteller 阅读(336) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-13 01:40 silentteller 阅读(270) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-13 00:52 silentteller 阅读(368) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-11 23:18 silentteller 阅读(464) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-11 23:08 silentteller 阅读(449) 评论(0) 推荐(1)
摘要:题目: Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Example: 阅读全文
posted @ 2019-05-11 00:15 silentteller 阅读(293) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-10 00:45 silentteller 阅读(585) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-08 00:03 silentteller 阅读(359) 评论(3) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-05-07 00:40 silentteller 阅读(365) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-04-23 23:55 silentteller 阅读(488) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-04-22 23:43 silentteller 阅读(299) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-04-22 00:05 silentteller 阅读(224) 评论(0) 推荐(0)
摘要:题目: 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: 分析: 给定一个 阅读全文
posted @ 2019-04-21 23:52 silentteller 阅读(275) 评论(0) 推荐(0)
摘要:题目: 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 阅读全文
posted @ 2019-04-21 23:24 silentteller 阅读(281) 评论(0) 推荐(0)
摘要:题目: Given an integer array, find three numbers whose product is maximum and output the maximum product. Example 1: Example 2: 分析: 给定一个数组,返回其中三个元素乘积的最大 阅读全文
posted @ 2019-04-21 00:55 silentteller 阅读(328) 评论(0) 推荐(0)