![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 68
sunshineMay_1014
美好的未来等着你,相信 努力 会创造奇迹~
我 从未停止脚步~
展开
-
leetcode之旅-easy(House Robber)
最近,一直在科研与刷题之间周旋。正在研究第三篇论文,实验室同年级都已经出现RANK A的档次了,压力山大!对于不读博的我来说,还是抓紧刷题比较实在。leetcode还没有做多少,但是我希望这个能够成为激励我不断加速的动力。对于算法已经放下很久的同学,我想说:不要灰心,从easy开始刷起,不断增加信心。(PS:我一直认为心理战术远比技术重要的多,做一个内心强大的程序媛)进入正原创 2015-04-15 16:17:25 · 324 阅读 · 0 评论 -
leetcode-Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->原创 2015-06-23 23:09:24 · 461 阅读 · 0 评论 -
leetcode Basic Calculator
Implement a basic calculator to evaluate a simple expression string.The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and em原创 2015-06-27 11:42:41 · 361 阅读 · 0 评论 -
leetcode Basic Calculator II
Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division shou原创 2015-06-27 16:11:12 · 369 阅读 · 0 评论 -
Regular Expression Matching
'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The function prototype should be:bool isMatch(c原创 2015-06-13 23:01:23 · 355 阅读 · 0 评论 -
Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is原创 2015-06-15 22:08:37 · 454 阅读 · 0 评论 -
Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.将千、百、十、个位数的值依次打表,将最终的字符串进行组合即可;class Solution {public: string get_bai(int原创 2015-06-14 18:30:33 · 397 阅读 · 0 评论 -
Letter Combinations of a Phone Number
iven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit str原创 2015-06-14 22:11:30 · 362 阅读 · 0 评论 -
Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. Y原创 2015-06-15 18:04:10 · 429 阅读 · 0 评论 -
Roman to Integer
Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.按千位,百位,十位,个位依次按类型枚举;class Solution {public: int romanToInt(string s) {原创 2015-06-14 20:26:43 · 297 阅读 · 0 评论 -
leetcode-Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of原创 2015-06-24 00:13:33 · 310 阅读 · 0 评论 -
leetcode-Subsets
Given a set of distinct integers, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.For原创 2015-05-18 18:51:43 · 383 阅读 · 0 评论 -
leetcode-triangle
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 following triangle[ [2], [3,4],原创 2015-05-18 16:51:23 · 325 阅读 · 0 评论 -
leetcode-Valid Parentheses
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all va原创 2015-04-21 19:04:11 · 335 阅读 · 0 评论 -
leetcode-jump game
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 maximum jump length at that position.Determine i原创 2015-05-21 10:58:18 · 330 阅读 · 0 评论 -
leetcode-jump Game2
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 maximum jump length at that position.Your goal i原创 2015-05-21 15:57:41 · 376 阅读 · 0 评论 -
Permutations II
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,1原创 2015-06-16 23:19:10 · 378 阅读 · 0 评论 -
leetcode-Simplify Path
Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"思路:取得每个 文件夹名称,针对“..” 和 "."的情况通过栈进行存储更新;最后目录输出还要有一个栈用于文件夹原创 2015-06-19 09:23:36 · 324 阅读 · 0 评论 -
leetcode - Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]原创 2015-05-18 18:06:41 · 343 阅读 · 0 评论 -
leetcode-Subsets II
Subsets II Given a collection of integers that might contain duplicates, nums, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain d原创 2015-05-18 19:06:36 · 415 阅读 · 0 评论 -
leetcode-Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]原创 2015-05-18 19:41:52 · 296 阅读 · 0 评论 -
leetcode-Spiral Matrix II
Given an integer n, generate a square matrix filled with elements from 1 to n2 in spiral order.For example,Given n = 3,You should return the following matrix:[ [ 1, 2, 3 ], [ 8, 9, 4 ],原创 2015-05-18 20:07:05 · 486 阅读 · 0 评论 -
leetcode - Reverse Words in a String
题意:Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Update (2015-02-12):For C programmers: Try to solve it in原创 2015-07-07 15:59:20 · 448 阅读 · 0 评论