-
Simplify Path
Mar 02, 2019
第三天(hhh,好像又很久没刷了), 又AC掉了逻辑题,或者说又是一道用if else加状态机搞定的题。 今天的题目是71. Simplify Path 以后还是不copy…
-
Reverse-String
Dec 16, 2017
第80天。 今天的题目是Reverse String: Write a function that takes a string as input and returns the string reversed. Example: Given s = “hello”, return “olleh”. 水的不能再水的题目. string reverseString(string s) { int i = 0,j = s.size() - 1; while(i < j) { swap(s[i++],s[j--]); } return s;…
-
Reverse-Words-in-a-String-III
Dec 15, 2017
第79天。 今天的题目是Reverse Words in a String III: Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Example 1: Input: “Let’s take LeetCode contest” Output: “s’teL ekat edoCteeL tsetnoc” Note: In the string, each word is separated by single…
-
Valid Parentheses
Sep 24, 2017
恩,照常打个卡(差点忘记)。。。。 由于比较晚才发现要刷个题(捂脸),所以找了个Easy的题目——Valid Parentheses Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if…