随笔分类 -  cpp刷Leetcode

上一页 1 2 3 4 5 6 ··· 8 下一页

第一遍刷完leetcode,过程非常纠结。 第二遍再过leetcode,看看自己能记得多少,顺便加深印象。
【Minimum Window】cpp
摘要:题目: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="ADOBECOD... 阅读全文

posted @ 2015-06-08 15:13 承续缘 阅读(216) 评论(0) 推荐(0) 编辑

【Merge Intervals】cpp
摘要:题目:Given a collection of intervals, merge all overlapping intervals.For example,Given[1,3],[2,6],[8,10],[15,18],return[1,6],[8,10],[15,18].代码:/** * De... 阅读全文

posted @ 2015-06-06 19:28 承续缘 阅读(251) 评论(0) 推荐(0) 编辑

【Insert Interval】cpp
摘要:题目:Given a set ofnon-overlappingintervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initia... 阅读全文

posted @ 2015-06-06 18:12 承续缘 阅读(337) 评论(0) 推荐(0) 编辑

【Palindrome Number】cpp
摘要:题目:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes?... 阅读全文

posted @ 2015-06-06 09:13 承续缘 阅读(150) 评论(0) 推荐(0) 编辑

【Reverse Integer】cpp
摘要:题目:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321click to show spoilers.Have you thought about this?Here are ... 阅读全文

posted @ 2015-06-05 15:07 承续缘 阅读(311) 评论(0) 推荐(0) 编辑

【Clone Graph】cpp
摘要:题目:Clone an undirected graph. Each node in the graph contains alabeland a list of itsneighbors.OJ's undirected graph serialization:Nodes are labeled u... 阅读全文

posted @ 2015-06-05 10:48 承续缘 阅读(256) 评论(0) 推荐(0) 编辑

【Word Break II】cpp
摘要:题目:Given a stringsand a dictionary of wordsdict, add spaces insto construct a sentence where each word is a valid dictionary word.Return all such poss... 阅读全文

posted @ 2015-06-05 08:28 承续缘 阅读(264) 评论(0) 推荐(0) 编辑

【Word Break】cpp
摘要:题目:Given a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.For exa... 阅读全文

posted @ 2015-06-04 21:56 承续缘 阅读(249) 评论(0) 推荐(0) 编辑

【Distinct Subsequences】cpp
摘要:题目:Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the o... 阅读全文

posted @ 2015-06-04 20:22 承续缘 阅读(170) 评论(0) 推荐(0) 编辑

【Decode Ways】cpp
摘要:题目:A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message co... 阅读全文

posted @ 2015-06-04 14:49 承续缘 阅读(216) 评论(0) 推荐(0) 编辑

【Edit Distance】cpp
摘要:题目:Given two wordsword1andword2, find the minimum number of steps required to convertword1toword2. (each operation is counted as 1 step.)You have the ... 阅读全文

posted @ 2015-06-04 10:10 承续缘 阅读(188) 评论(0) 推荐(0) 编辑

【Minimum Path Sum】cpp
摘要:题目:Given amxngrid filled with non-negative numbers, find a path from top left to bottom right whichminimizesthe sum of all numbers along its path.Note... 阅读全文

posted @ 2015-06-03 20:14 承续缘 阅读(137) 评论(0) 推荐(0) 编辑

【Scramble String】cpp
摘要:题目:Given a strings1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representat... 阅读全文

posted @ 2015-06-03 14:02 承续缘 阅读(199) 评论(0) 推荐(0) 编辑

【Interleaving String】cpp
摘要:题目:Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", return true.Whens... 阅读全文

posted @ 2015-06-02 19:13 承续缘 阅读(229) 评论(0) 推荐(0) 编辑

【Best Time to Buy and Sell Stock III 】cpp
摘要:题目:Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complet... 阅读全文

posted @ 2015-06-02 14:18 承续缘 阅读(178) 评论(0) 推荐(0) 编辑

【Maximal Rectangle】cpp
摘要:题目:Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.代码:class Solution {public: ... 阅读全文

posted @ 2015-06-02 10:49 承续缘 阅读(268) 评论(0) 推荐(0) 编辑

【palindrome partitioning II】cpp
摘要:题目:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning ... 阅读全文

posted @ 2015-06-01 18:54 承续缘 阅读(196) 评论(0) 推荐(0) 编辑

【Maximum Subarray 】cpp
摘要:题目: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... 阅读全文

posted @ 2015-05-30 17:29 承续缘 阅读(183) 评论(0) 推荐(0) 编辑

【Triangle 】cpp
摘要:题目:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the ... 阅读全文

posted @ 2015-05-30 16:09 承续缘 阅读(274) 评论(0) 推荐(0) 编辑

【Container With Most Water】cpp
摘要:题目:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints ... 阅读全文

posted @ 2015-05-30 15:22 承续缘 阅读(129) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 8 下一页

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示