随笔分类 -  LeetCode

上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页
摘要:You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not need t 阅读全文
posted @ 2017-12-14 19:30 __Meng 阅读(195) 评论(0) 推荐(0)
摘要:Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: 阅读全文
posted @ 2017-12-13 11:08 __Meng 阅读(214) 评论(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 ident 阅读全文
posted @ 2017-12-12 10:56 __Meng 阅读(159) 评论(0) 推荐(0)
摘要:You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane 阅读全文
posted @ 2017-12-11 10:10 __Meng 阅读(285) 评论(0) 推荐(0)
摘要:Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array. Example 1: Note: 以数组的形式返回每个层次上的节点的平均值 C++( 阅读全文
posted @ 2017-12-08 16:24 __Meng 阅读(177) 评论(0) 推荐(0)
摘要:You are given a data structure of employee information, which includes the employee's unique id, his importance value and his directsubordinates' id. 阅读全文
posted @ 2017-12-07 10:24 __Meng 阅读(229) 评论(0) 推荐(0)
摘要:Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. E 阅读全文
posted @ 2017-12-06 19:17 __Meng 阅读(154) 评论(0) 推荐(0)
摘要:Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2017-12-05 17:28 __Meng 阅读(219) 评论(0) 推荐(0)
摘要:Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of 阅读全文
posted @ 2017-12-04 10:36 __Meng 阅读(285) 评论(0) 推荐(0)
摘要:Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t 阅读全文
posted @ 2017-12-03 21:04 __Meng 阅读(305) 评论(0) 推荐(0)
摘要:We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N 阅读全文
posted @ 2017-12-01 10:01 __Meng 阅读(174) 评论(1) 推荐(1)
摘要:Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo 阅读全文
posted @ 2017-11-30 10:24 __Meng 阅读(583) 评论(0) 推荐(0)
摘要:Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals 阅读全文
posted @ 2017-11-29 17:22 __Meng 阅读(180) 评论(0) 推荐(0)
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2017-11-28 10:06 __Meng 阅读(205) 评论(0) 推荐(0)
摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Note: 区间求和 C++(166ms): Java(150ms): 阅读全文
posted @ 2017-11-27 15:36 __Meng 阅读(167) 评论(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 you cl 阅读全文
posted @ 2017-11-26 12:40 __Meng 阅读(111) 评论(0) 推荐(0)
摘要:Invert a binary tree. to C++(3ms): 阅读全文
posted @ 2017-11-25 11:47 __Meng 阅读(207) 评论(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 are n 阅读全文
posted @ 2017-11-24 10:26 __Meng 阅读(152) 评论(0) 推荐(0)
摘要:Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, ... Note:n is positive and will fit within the range of a 32-bi 阅读全文
posted @ 2017-11-23 10:09 __Meng 阅读(215) 评论(0) 推荐(0)
摘要:You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total number 阅读全文
posted @ 2017-11-22 16:49 __Meng 阅读(167) 评论(0) 推荐(0)

上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页