随笔分类 -  Leetcode+题

上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the hist 阅读全文
posted @ 2017-07-15 15:40 王大咩的图书馆 阅读(3596) 评论(2) 推荐(1)
摘要:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example,S ="ADOBECODE 阅读全文
posted @ 2017-07-14 21:05 王大咩的图书馆 阅读(314) 评论(0) 推荐(1)
摘要:Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array[−2,1,−3,4,−1,2,1 阅读全文
posted @ 2017-07-14 16:11 王大咩的图书馆 阅读(394) 评论(0) 推荐(0)
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
posted @ 2017-07-14 15:34 王大咩的图书馆 阅读(782) 评论(0) 推荐(0)
摘要:Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
posted @ 2017-07-14 10:49 王大咩的图书馆 阅读(335) 评论(0) 推荐(0)
摘要:There are N gas stations along a circular route, where the amount of gas at station i isgas[i]. You have a car with an unlimited gas tank and it costs 阅读全文
posted @ 2017-07-13 17:02 王大咩的图书馆 阅读(354) 评论(0) 推荐(0)
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan 阅读全文
posted @ 2017-07-13 16:01 王大咩的图书馆 阅读(207) 评论(0) 推荐(0)
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: " 阅读全文
posted @ 2017-07-13 11:08 王大咩的图书馆 阅读(2886) 评论(0) 推荐(0)
摘要:Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文
posted @ 2017-07-13 10:18 王大咩的图书馆 阅读(296) 评论(0) 推荐(0)
摘要:Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are indicated by the character'.'. You may assume that there will be 阅读全文
posted @ 2017-07-12 09:34 王大咩的图书馆 阅读(339) 评论(0) 推荐(0)
摘要:Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled wit 阅读全文
posted @ 2017-07-11 19:31 王大咩的图书馆 阅读(261) 评论(0) 推荐(0)
摘要:Given a set of candidate numbers ( C ) and a target number ( T ), find all unique combinations in C where the candidate numbers sums to T . The same r 阅读全文
posted @ 2017-07-11 15:58 王大咩的图书馆 阅读(200) 评论(0) 推荐(0)
摘要:Given a collection of candidate numbers ( C ) and a target number ( T), find all unique combinations in C where the candidate numbers sums to T . Each 阅读全文
posted @ 2017-07-11 15:44 王大咩的图书馆 阅读(231) 评论(0) 推荐(0)
摘要:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in or 阅读全文
posted @ 2017-07-11 15:02 王大咩的图书馆 阅读(162) 评论(0) 推荐(0)
摘要:Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the or 阅读全文
posted @ 2017-07-10 18:46 王大咩的图书馆 阅读(329) 评论(0) 推荐(0)
摘要:Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjac 阅读全文
posted @ 2017-07-09 21:04 王大咩的图书馆 阅读(294) 评论(0) 推荐(0)
摘要:Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a functio 阅读全文
posted @ 2017-07-09 15:22 王大咩的图书馆 阅读(188) 评论(0) 推荐(0)
摘要:Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2). You are given a target value 阅读全文
posted @ 2017-07-09 15:00 王大咩的图书馆 阅读(296) 评论(0) 推荐(0)
摘要:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is: 题意:给定1...n个数, 阅读全文
posted @ 2017-07-09 10:56 王大咩的图书馆 阅读(176) 评论(0) 推荐(0)
摘要:Follow up for N-Queens problem. Now, instead outputting board configurations, return the total number of distinct solutions. 题意:仅要求给出解的种数。 思路:这题是n que 阅读全文
posted @ 2017-07-08 16:54 王大咩的图书馆 阅读(183) 评论(0) 推荐(0)

上一页 1 2 3 4 5 6 7 ··· 9 下一页