![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
feng鸽
一点点的成长,最终会成为参天大树.
展开
-
leetcode第一题(TWO SUM)
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the same原创 2018-02-03 23:29:42 · 140 阅读 · 0 评论 -
LeetCode787题
There are n cities connected by m flights. Each fight starts from city u and arrives at v with a price w.Now given all the cities and fights, together with starting city src and the destination dst, y...原创 2018-04-06 14:06:15 · 373 阅读 · 0 评论 -
LeetCode第676题
Implement a magic directory with buildDict, and search methods.For the method buildDict, you'll be given a list of non-repetitive words to build a dictionary.For the method search, you'll be given a w...原创 2018-04-05 21:37:49 · 214 阅读 · 0 评论 -
LeetCode 695. Max Area of Island
Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrou...原创 2018-04-02 00:54:11 · 124 阅读 · 0 评论 -
leetcode605题(2 Keys Keyboard)
class Solution { public: int minSteps(int n) { if (n <= 1) { // 如果需要的长度小于等于1,那就不需要操作了,直接返回0 return 0; } int ans = 0; // 初始化操作的次数 int left = n - 1; /...翻译 2018-03-26 22:30:37 · 118 阅读 · 0 评论 -
LeetCode605题 (2 Keys Keyboard)
int MAX = 1001; class Solution { public: int dp(int n, int have, int c) { //have代表已经有了几个A,c代表当前复制板上有几个A if (n == have) { // 如果已经到达目标,返回0 return 0; } else if (n < ha...翻译 2018-03-26 22:14:14 · 130 阅读 · 0 评论 -
LeetCode第628题
Given an integer array, find three numbers whose product is maximum and output the maximum product.Example 1:Input: [1,2,3] Output: 6 Example 2:Input: [1,2,3,4] Output: 24 Note:The length of the given...原创 2018-04-01 17:11:05 · 119 阅读 · 0 评论 -
LeetCode第797题 All Paths From Source to Target
class Solution {public: vector<vector<int>> paths; void findPath(vector<vector<int>> &graph ,vector<int> path,int x,int target) { if(x==target) ...原创 2018-04-07 21:25:56 · 174 阅读 · 0 评论 -
leetcode第十题
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原创 2018-02-05 00:11:41 · 414 阅读 · 0 评论 -
LeetCode 789
class Solution {public: bool escapeGhosts(vector<vector<int>>& ghosts, vector<int>& target) { int myDistance=fabs(target[0])+fabs(target[1]); for(int i=0;i&...原创 2018-04-06 22:30:35 · 172 阅读 · 0 评论