随笔分类 -  LeetCode

上一页 1 ··· 45 46 47 48 49 50 51 52 53 ··· 61 下一页
摘要:Given a string arraywords, find the maximum value oflength(word[i]) * length(word[j])where the two words do not share common letters. You may assume t... 阅读全文
posted @ 2015-12-30 21:06 Grandyang 阅读(11378) 评论(4) 推荐(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 @ 2015-12-29 13:09 Grandyang 阅读(20110) 评论(1) 推荐(0)
摘要:You are given an integer array nums and you have to return a new counts array. The countsarray has the property where counts[i] is the number of small 阅读全文
posted @ 2015-12-26 17:42 Grandyang 阅读(31177) 评论(18) 推荐(0)
摘要:Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloon 阅读全文
posted @ 2015-11-30 10:21 Grandyang 阅读(29207) 评论(23) 推荐(5)
摘要:For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible roote 阅读全文
posted @ 2015-11-27 12:25 Grandyang 阅读(26376) 评论(10) 推荐(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 complet... 阅读全文
posted @ 2015-11-26 13:03 Grandyang 阅读(32460) 评论(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 阅读(24738) 评论(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 阅读(12828) 评论(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 阅读(13273) 评论(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 阅读(14846) 评论(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 阅读(34629) 评论(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 阅读(51835) 评论(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 阅读(15723) 评论(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 阅读(29939) 评论(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 阅读(20889) 评论(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 阅读(12021) 评论(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 阅读(15811) 评论(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 阅读(31370) 评论(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 阅读(47462) 评论(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 阅读(11073) 评论(3) 推荐(1)

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