
leetcode
文章平均质量分 73
-缘故-
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode 10.6 Restore IP Addresses
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given "25525511135", return ["255.255.11.135", "255.255.111.35"]. (Order原创 2016-04-26 15:04:54 · 262 阅读 · 0 评论 -
LeetCode 10.4 N-Qeens
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle.原创 2016-04-26 15:01:46 · 448 阅读 · 0 评论 -
LeetCode 10.9 Generate Parentheses
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: "((()))", "(()())", "(())()", "()(())", "()()原创 2016-04-27 10:08:58 · 263 阅读 · 0 评论 -
LeetCode 2.1.16 Rotate Image
2.1.16 Rotate Image 描述 You are given an n × n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise). Follow up: Could you do this in-place? 分析 首先想到,纯模拟,从外到内一圈一圈的转,但这个方法太慢原创 2016-04-18 11:13:59 · 331 阅读 · 0 评论 -
LeetCode 2.1.10 4Sum
2.1.10 4Sum 描述 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target?Find all unique quadruplets in the array which gives the sum of targe原创 2016-04-18 11:20:09 · 293 阅读 · 0 评论 -
LeetCode 2.1.21 Gas Station
2.1.21 Gas Station 描述 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] o原创 2016-04-18 12:17:06 · 349 阅读 · 0 评论 -
LeetCode 2.1.24 Single Number II
2.1.24 Single Number II 描述 Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could yo原创 2016-04-18 13:37:57 · 381 阅读 · 0 评论 -
LeetCode 3.5 Longest Palindromic Substring
3.5 Longest Palindromic Substring 描述 Given a string S, find the longest palindromic substring in S. You may assume that the maximumlength of S is 1000, and there exists one unique longest palindr原创 2016-04-18 15:38:26 · 342 阅读 · 0 评论 -
LeetCode 4.1.3 Largest Rectangle in Histogram
4.1.3 Largest Rectangle in Histogram 描述 Given n non-negative integers representing the histogram’s bar height where the width of each bar is1, find the area of largest rectangle in the histogram.原创 2016-04-18 17:18:15 · 395 阅读 · 0 评论 -
LeetCode 10.7 Combination Sum
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 repeated number may be chosen from C unlimited num原创 2016-04-26 15:08:15 · 257 阅读 · 0 评论 -
LeetCode 13.7 Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = “great”: great / \ gr原创 2016-05-03 16:01:14 · 388 阅读 · 0 评论