- 博客(13)
- 收藏
- 关注
原创 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 381
原创 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 369
原创 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 321
原创 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 492
原创 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 346
原创 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 406
原创 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 483
原创 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 457
原创 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 387
原创 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 308
原创 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 409
原创 Container With Most Water
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two
2015-06-14 17:51:41 327
原创 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 369
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人