07 2016 档案

摘要:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Example: Given n = 2, return 91. (The answer should be the 阅读全文
posted @ 2016-07-31 08:12 LiBlog 阅读(125) 评论(0) 推荐(0) 编辑
摘要:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The 阅读全文
posted @ 2016-07-28 14:05 LiBlog 阅读(387) 评论(0) 推荐(0) 编辑
摘要:Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or 阅读全文
posted @ 2016-07-24 12:38 LiBlog 阅读(189) 评论(0) 推荐(0) 编辑
摘要:Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the u 阅读全文
posted @ 2016-07-24 11:30 LiBlog 阅读(204) 评论(0) 推荐(0) 编辑
摘要:Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-07-22 14:45 LiBlog 阅读(199) 评论(0) 推荐(0) 编辑
摘要:Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2016-07-22 14:13 LiBlog 阅读(144) 评论(0) 推荐(0) 编辑
摘要:Assume you have an array of length n initialized with all 0's and are given k update operations. Each operation is represented as a triplet: [startInd 阅读全文
posted @ 2016-07-21 14:35 LiBlog 阅读(115) 评论(0) 推荐(0) 编辑
摘要:Design a hit counter which counts the number of hits received in the past 5 minutes. Each function accepts a timestamp parameter (in seconds granulari 阅读全文
posted @ 2016-07-21 14:29 LiBlog 阅读(244) 评论(0) 推荐(0) 编辑
摘要:You want to build a house on an empty land which reaches all buildings in the shortest amount of distance. You can only move up, down, left and right. 阅读全文
posted @ 2016-07-21 13:41 LiBlog 阅读(339) 评论(0) 推荐(0) 编辑
摘要:Given a sorted integer array without duplicates, return the summary of its ranges. For example, given [0,1,2,4,5,7], return ["0->2","4->5","7"]. Credi 阅读全文
posted @ 2016-07-21 12:36 LiBlog 阅读(121) 评论(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 @ 2016-07-20 14:38 LiBlog 阅读(144) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its sum is no larger than k. Example: The 阅读全文
posted @ 2016-07-20 13:12 LiBlog 阅读(319) 评论(0) 推荐(0) 编辑
摘要:Given an array of n positive integers and a positive integer s, find the minimal length of a subarray of which the sum ≥ s. If there isn't one, return 阅读全文
posted @ 2016-07-19 15:08 LiBlog 阅读(121) 评论(0) 推荐(0) 编辑
摘要:Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your 阅读全文
posted @ 2016-07-19 13:49 LiBlog 阅读(147) 评论(0) 推荐(0) 编辑
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
posted @ 2016-07-18 15:03 LiBlog 阅读(118) 评论(0) 推荐(0) 编辑
摘要:You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u,v) which consists of one element from th 阅读全文
posted @ 2016-07-18 14:48 LiBlog 阅读(124) 评论(0) 推荐(0) 编辑
摘要:Design a logger system that receive stream of messages along with its timestamps, each message should be printed if and only if it is not printed in t 阅读全文
posted @ 2016-07-18 14:44 LiBlog 阅读(210) 评论(0) 推荐(0) 编辑
摘要:There is a new alien language which uses the latin alphabet. However, the order among letters are unknown to you. You receive a list of words from the 阅读全文
posted @ 2016-07-18 14:18 LiBlog 阅读(136) 评论(0) 推荐(0) 编辑
摘要:Given a non-empty binary search tree and a target value, find the value in the BST that is closest to the target. Note: Given target value is a floati 阅读全文
posted @ 2016-07-13 15:46 LiBlog 阅读(234) 评论(0) 推荐(0) 编辑
摘要:You are given an array x of n positive numbers. You start at point (0,0) and moves x[0] metres to the north, then x[1] metres to the west, x[2] metres 阅读全文
posted @ 2016-07-13 14:49 LiBlog 阅读(139) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示