随笔分类 -  LeetCode

上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 61 下一页
摘要: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 complet... 阅读全文
posted @ 2015-11-26 13:03 Grandyang 阅读(32143) 评论(5) 推荐(1) 编辑
摘要:Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums by upd 阅读全文
posted @ 2015-11-22 11:22 Grandyang 阅读(24339) 评论(12) 推荐(1) 编辑
摘要:Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three numbers. Except for the f 阅读全文
posted @ 2015-11-18 12:18 Grandyang 阅读(12700) 评论(7) 推荐(0) 编辑
摘要:Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col1) and lower right corner (row2 阅读全文
posted @ 2015-11-12 13:59 Grandyang 阅读(13142) 评论(0) 推荐(1) 编辑
摘要:Given an integer array nums, find the sum of the elements between indices iand j (i ≤ j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumRa 阅读全文
posted @ 2015-11-10 12:03 Grandyang 阅读(14715) 评论(5) 推荐(0) 编辑
摘要:Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont 阅读全文
posted @ 2015-11-07 13:07 Grandyang 阅读(34321) 评论(24) 推荐(0) 编辑
摘要:Given an unsorted array of integers, find the length of longest increasing subsequence. Example: Input: [10,9,2,5,3,7,101,18] Output: 4 Explanation: T 阅读全文
posted @ 2015-11-05 08:18 Grandyang 阅读(50873) 评论(19) 推荐(5) 编辑
摘要:You are playing the followingBulls and Cowsgame with your friend: You write a 4-digit secret number and ask your friend to guess it, each time your fr... 阅读全文
posted @ 2015-11-02 04:37 Grandyang 阅读(15576) 评论(4) 推荐(0) 编辑
摘要:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文
posted @ 2015-10-27 13:04 Grandyang 阅读(29567) 评论(4) 推荐(3) 编辑
摘要:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two... 阅读全文
posted @ 2015-10-21 07:25 Grandyang 阅读(20415) 评论(6) 推荐(2) 编辑
摘要:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 ston 阅读全文
posted @ 2015-10-12 23:22 Grandyang 阅读(11861) 评论(0) 推荐(0) 编辑
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2015-10-06 13:21 Grandyang 阅读(15522) 评论(10) 推荐(0) 编辑
摘要:According to the Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John 阅读全文
posted @ 2015-10-04 13:20 Grandyang 阅读(30982) 评论(8) 推荐(6) 编辑
摘要:Given an array of integers nums containing n + 1 integers where each integer is in the range [1, n] inclusive. There is only one repeated number in nu 阅读全文
posted @ 2015-09-28 11:37 Grandyang 阅读(46519) 评论(19) 推荐(4) 编辑
摘要:Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it e 阅读全文
posted @ 2015-09-21 01:52 Grandyang 阅读(10997) 评论(3) 推荐(1) 编辑
摘要:Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. For example, giv 阅读全文
posted @ 2015-09-20 01:02 Grandyang 阅读(18744) 评论(0) 推荐(1) 编辑
摘要:Given a string that contains only digits 0-9 and a target value, return all possibilities to add binaryoperators (not unary) +, -, or * between the di 阅读全文
posted @ 2015-09-16 21:01 Grandyang 阅读(19989) 评论(6) 推荐(2) 编辑
摘要:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Input: n = 12 O 阅读全文
posted @ 2015-09-11 12:06 Grandyang 阅读(41749) 评论(17) 推荐(2) 编辑
摘要:You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2015-09-08 02:30 Grandyang 阅读(10623) 评论(3) 推荐(0) 编辑
摘要:Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper and citations is sorted i 阅读全文
posted @ 2015-09-05 05:45 Grandyang 阅读(12364) 评论(7) 推荐(0) 编辑

上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 61 下一页
Fork me on GitHub