随笔分类 -  cpp刷Leetcode

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

第一遍刷完leetcode,过程非常纠结。 第二遍再过leetcode,看看自己能记得多少,顺便加深印象。
【Longest Substring Without Repeating Characters】cpp
摘要:题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters... 阅读全文

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

【Best Time to Buy and Sell Stock II】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-05-30 09:19 承续缘 阅读(191) 评论(0) 推荐(0) 编辑

【Best Time to Buy and Sell Stock】cpp
摘要:题目:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction ... 阅读全文

posted @ 2015-05-30 08:59 承续缘 阅读(133) 评论(0) 推荐(0) 编辑

【Jump Game II 】cpp
摘要:题目: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 max... 阅读全文

posted @ 2015-05-29 21:35 承续缘 阅读(199) 评论(0) 推荐(0) 编辑

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

posted @ 2015-05-29 19:50 承续缘 阅读(221) 评论(0) 推荐(0) 编辑

【 Sqrt(x) 】cpp
摘要:题目:Implementint sqrt(int x).Compute and return the square root ofx.代码:class Solution {public: int mySqrt(int x) { if (x mid )... 阅读全文

posted @ 2015-05-29 15:16 承续缘 阅读(455) 评论(0) 推荐(0) 编辑

【Pow(x,n)】
摘要:题目:Implement pow(x,n).代码:class Solution {public: double myPow(double x, int n) { double ret = Solution::positivePow(fabs(x), ... 阅读全文

posted @ 2015-05-29 11:23 承续缘 阅读(328) 评论(0) 推荐(0) 编辑

【Word Search】cpp
摘要:题目: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 "adj... 阅读全文

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

【Sudoku Solver】cpp
摘要:题目: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 @ 2015-05-28 21:46 承续缘 阅读(170) 评论(0) 推荐(0) 编辑

【Generate Parentheses】cpp
摘要:题目:Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"(((... 阅读全文

posted @ 2015-05-28 16:17 承续缘 阅读(168) 评论(0) 推荐(0) 编辑

【Combination Sum II 】cpp
摘要:题目:Given a collection of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Each numb... 阅读全文

posted @ 2015-05-28 15:27 承续缘 阅读(184) 评论(0) 推荐(0) 编辑

【Combination Sum 】cpp
摘要:题目:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesamerepeated ... 阅读全文

posted @ 2015-05-28 14:47 承续缘 阅读(248) 评论(0) 推荐(0) 编辑

【N-Quens II】cpp
摘要:题目:Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.代码:class Solution {publi... 阅读全文

posted @ 2015-05-27 11:58 承续缘 阅读(287) 评论(0) 推荐(0) 编辑

【N-Queens】cpp
摘要:题目:Then-queens puzzle is the problem of placingnqueens on ann×nchessboard such that no two queens attack each other.Given an integern, return all dist... 阅读全文

posted @ 2015-05-27 11:22 承续缘 阅读(220) 评论(0) 推荐(0) 编辑

【Unique Paths II】cpp
摘要:题目: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 spac... 阅读全文

posted @ 2015-05-27 09:01 承续缘 阅读(191) 评论(0) 推荐(0) 编辑

【Unique Paths】cpp
摘要:题目:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any poi... 阅读全文

posted @ 2015-05-26 16:39 承续缘 阅读(200) 评论(0) 推荐(0) 编辑

【Palindrome Partitioning】cpp
摘要:题目:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, ... 阅读全文

posted @ 2015-05-26 15:41 承续缘 阅读(181) 评论(0) 推荐(0) 编辑

【Surrounded Regions】cpp
摘要:题目:Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounded reg... 阅读全文

posted @ 2015-05-26 11:06 承续缘 阅读(244) 评论(0) 推荐(0) 编辑

【Word Ladder II】cpp
摘要:题目:Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be chan... 阅读全文

posted @ 2015-05-25 15:29 承续缘 阅读(224) 评论(0) 推荐(0) 编辑

【word ladder】cpp
摘要:题目:Given two words (beginWordandendWord), and a dictionary, find the length of shortest transformation sequence frombeginWordtoendWord, such that:Only... 阅读全文

posted @ 2015-05-25 10:47 承续缘 阅读(169) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 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

统计

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