随笔分类 -  LeetCode

上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 61 下一页
摘要:Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or 阅读全文
posted @ 2015-06-12 02:30 Grandyang 阅读(28235) 评论(5) 推荐(1)
摘要:Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to 阅读全文
posted @ 2015-06-11 12:49 Grandyang 阅读(13637) 评论(5) 推荐(0)
摘要:Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia:In a complete binary tree every lev 阅读全文
posted @ 2015-06-10 23:49 Grandyang 阅读(19573) 评论(7) 推荐(1)
摘要:Find the total area covered by two rectilinearrectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner as sh 阅读全文
posted @ 2015-06-09 12:56 Grandyang 阅读(10869) 评论(4) 推荐(0)
摘要:Given a 2D board containing 'X' and 'O'(the letter O), capture all regions surrounded by 'X'. A region is captured by flipping all 'O's into 'X's in t 阅读全文
posted @ 2015-06-05 23:55 Grandyang 阅读(22801) 评论(26) 推荐(0)
摘要:Given an m x n binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. Example 1: Input: matrix = [["1 阅读全文
posted @ 2015-06-03 23:22 Grandyang 阅读(27910) 评论(16) 推荐(0)
摘要:Given two words (beginWord and endWord), and a dictionary's word list, find all shortest transformation sequence(s) from beginWord to endWord, such th 阅读全文
posted @ 2015-06-03 02:31 Grandyang 阅读(26776) 评论(14) 推荐(0)
摘要:Given an array of integers, find out whether there are two distinct indices i and j in the array such that the difference between nums[i] and nums[j] 阅读全文
posted @ 2015-06-01 23:33 Grandyang 阅读(26220) 评论(16) 推荐(0)
摘要:A transformation sequence from word beginWord to word endWord using a dictionary wordList is a sequence of words beginWord -> s1 -> s2 -> ... -> sk su 阅读全文
posted @ 2015-05-30 07:06 Grandyang 阅读(27837) 评论(19) 推荐(3)
摘要:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Example 阅读全文
posted @ 2015-05-30 04:10 Grandyang 阅读(36329) 评论(26) 推荐(2)
摘要:Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the  阅读全文
posted @ 2015-05-30 00:06 Grandyang 阅读(18360) 评论(11) 推荐(0)
摘要:Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be 阅读全文
posted @ 2015-05-29 11:04 Grandyang 阅读(14285) 评论(0) 推荐(2)
摘要:Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the arr... 阅读全文
posted @ 2015-05-28 21:40 Grandyang 阅读(15938) 评论(3) 推荐(0)
摘要:A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are give 阅读全文
posted @ 2015-05-27 22:24 Grandyang 阅读(27075) 评论(10) 推荐(1)
摘要:Given a string s, you are allowed to convert it to a palindrome by adding characters in front of it. Find and return the shortest palindrome you can f 阅读全文
posted @ 2015-05-23 03:09 Grandyang 阅读(28764) 评论(13) 推荐(2)
摘要:You are given a string s and an array of strings words. All the strings of words are of the same length. A concatenated substring in s is a substring 阅读全文
posted @ 2015-05-22 00:07 Grandyang 阅读(23753) 评论(11) 推荐(0)
摘要:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are ar 阅读全文
posted @ 2015-05-21 03:26 Grandyang 阅读(26132) 评论(10) 推荐(1)
摘要:Given an m x n board of characters and a list of strings words, return all words on the board. Each word must be constructed from letters of sequentia 阅读全文
posted @ 2015-05-20 00:06 Grandyang 阅读(22363) 评论(10) 推荐(0)
摘要:Given an array nums of n integers, return an array of all the unique quadruplets [nums[a], nums[b], nums[c], nums[d]] such that: 0 <= a, b, c, d < n a 阅读全文
posted @ 2015-05-19 23:28 Grandyang 阅读(37140) 评论(16) 推荐(2)
摘要:Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of t 阅读全文
posted @ 2015-05-18 02:24 Grandyang 阅读(27602) 评论(2) 推荐(1)

上一页 1 ··· 48 49 50 51 52 53 54 55 56 ··· 61 下一页
Fork me on GitHub