- 博客(17)
- 收藏
- 关注
原创 算法概论作业8.3
8.3 STINGY SAT is the following problem: given a set of clauses ( each a disjunction of literals) and an integer k, find a satisfying assignment in which at most k variables are true, if such an assi
2017-12-31 23:26:33 165
原创 [LeetCode]Burst Balloons
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 balloons. If the you burst balloon i you will get num
2017-12-21 22:50:47 104
原创 [LeetCode] 3Sum
Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must not contain d
2017-12-18 22:58:53 104
原创 [LeetCode] Maximal Rectangle
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.For example, given the following matrix:1 0 1 0 01 0 1 1 11 1 1 1 11 0 0 1
2017-12-11 17:54:59 129
原创 [LeetCode] Unique Paths II
Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space is marked as 1 and 0 respectively in the
2017-11-26 12:02:55 125
原创 [LeetCode]Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin
2017-11-19 20:28:24 96
原创 [LeetCode] Unique Paths
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the
2017-11-12 12:25:34 281
原创 [LeetCode] Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the longest valid parentheses substring is "()",
2017-11-05 16:45:19 105
原创 [LeetCode] Maximum Subarray
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,-5,4],the contiguous subarray [4,-1,2,1] ha
2017-10-29 16:49:18 139
原创 [LeetCode]Regular Expression Matching
Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input st
2017-10-22 15:37:39 125
原创 [LeetCode]Reverse Integer
Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Note:The input is assumed to be a 32-bit signed integer. Your function
2017-10-15 14:59:30 96
原创 [LeetCode] ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I
2017-10-07 18:48:11 192
原创 [LeetCode] Longest Palindromic Substring
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.
2017-09-28 18:05:21 116
原创 [LeetCode] String to Integer (atoi)
Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca
2017-09-23 12:19:38 113
原创 [LeetCode]Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "
2017-09-15 13:41:41 128
原创 [LeetCode]Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i
2017-09-07 15:14:43 115
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人