随笔分类 -  Leetcode

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 23 下一页
摘要:949. Largest Time for Given Digits (string::compare) Given an array of 4 digits, return the largest 24 hour time that can be made. The smallest 24 hou 阅读全文
posted @ 2018-12-02 12:55 Veritas_des_Liberty 阅读(225) 评论(0) 推荐(0) 编辑
摘要:On an infinite number line (x-axis), we drop given squares in the order they are given. The i-th square dropped (positions[i] = (left, side_length)) i 阅读全文
posted @ 2018-12-01 18:15 Veritas_des_Liberty 阅读(440) 评论(0) 推荐(0) 编辑
摘要:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a g 阅读全文
posted @ 2018-12-01 17:17 Veritas_des_Liberty 阅读(172) 评论(0) 推荐(0) 编辑
摘要:A Range Module is a module that tracks ranges of numbers. Your task is to design and implement the following interfaces in an efficient manner. addRan 阅读全文
posted @ 2018-12-01 12:38 Veritas_des_Liberty 阅读(355) 评论(0) 推荐(0) 编辑
摘要:Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Input: 1 \ 3 / 2 O 阅读全文
posted @ 2018-12-01 11:04 Veritas_des_Liberty 阅读(289) 评论(0) 推荐(0) 编辑
摘要:Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You need to return the number of important reverse pai 阅读全文
posted @ 2018-11-30 22:34 Veritas_des_Liberty 阅读(292) 评论(0) 推荐(0) 编辑
摘要:Given a data stream input of non-negative integers a1, a2, ..., an, ..., summarize the numbers seen so far as a list of disjoint intervals. For exampl 阅读全文
posted @ 2018-11-29 22:34 Veritas_des_Liberty 阅读(433) 评论(0) 推荐(0) 编辑
摘要:Given an integer array nums, return the number of range sums that lie in [lower, upper] inclusive.Range sum S(i, j) is defined as the sum of the eleme 阅读全文
posted @ 2018-11-29 21:13 Veritas_des_Liberty 阅读(279) 评论(0) 推荐(0) 编辑
摘要:You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smal 阅读全文
posted @ 2018-11-28 21:18 Veritas_des_Liberty 阅读(231) 评论(0) 推荐(0) 编辑
摘要:Given an array where elements are sorted in ascending order, convert it to a height balanced BST. For this problem, a height-balanced binary tree is d 阅读全文
posted @ 2018-11-27 15:26 Veritas_des_Liberty 阅读(176) 评论(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 dep 阅读全文
posted @ 2018-11-27 13:09 Veritas_des_Liberty 阅读(174) 评论(0) 推荐(0) 编辑
摘要:Given an array of integers, find out whether there are two distinct indices i and j in the array such that the absolute difference between nums[i] and 阅读全文
posted @ 2018-11-26 22:11 Veritas_des_Liberty 阅读(189) 评论(0) 推荐(0) 编辑
摘要:945. Minimum Increment to Make Array Unique Given an array of integers A, a move consists of choosing any A[i], and incrementing it by 1. Return the l 阅读全文
posted @ 2018-11-25 12:44 Veritas_des_Liberty 阅读(360) 评论(0) 推荐(0) 编辑
摘要:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2018-11-24 22:30 Veritas_des_Liberty 阅读(187) 评论(0) 推荐(0) 编辑
摘要:Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. 阅读全文
posted @ 2018-11-24 22:11 Veritas_des_Liberty 阅读(286) 评论(0) 推荐(0) 编辑
摘要:Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of th 阅读全文
posted @ 2018-11-24 18:31 Veritas_des_Liberty 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Given the root node of a binary search tree (BST) and a value to be inserted into the tree, insert the value into the BST. Return the root node of the 阅读全文
posted @ 2018-11-24 12:22 Veritas_des_Liberty 阅读(211) 评论(0) 推荐(0) 编辑
摘要:Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Retu 阅读全文
posted @ 2018-11-24 11:40 Veritas_des_Liberty 阅读(190) 评论(0) 推荐(0) 编辑
摘要:Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST. Calling next() will return the n 阅读全文
posted @ 2018-11-24 10:51 Veritas_des_Liberty 阅读(225) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only 阅读全文
posted @ 2018-11-24 09:58 Veritas_des_Liberty 阅读(218) 评论(0) 推荐(0) 编辑

上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 23 下一页