1、题目描述 Implement a basic calculator to evaluate a simple expression string. The expression string may contain …
标签:LeetCode
[Leetcode] Simplify Path
题目链接https://oj.leetcode.com/problems/simplify-path/ Description Given an absolute path for a file (Unix-style)…
leetCode_697. Degree of an Array
题目描述: Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximu…
536. Construct Binary Tree from String
You need to construct a binary tree from a string consisting of parenthesis and integers. The whole input repr…
225. Implement Stack using Queues
225. Implement Stack using Queues 题目: https://leetcode.com/problems/implement-stack-using-queues/ 难度: Easy 又到了…
Leetcode - Lexicographical Numbers
My code: public class Solution { public List<Integer> lexicalOrder(int n) { List<Integer> ret = ne…
516. 最长回文子序列
问题 这个题目的dp 状态很好理解, 但是状态转化公式需要再总结一下 class Solution(object): def longestPalindromeSubseq(self, s): """ :type s: …
LeetCode 7. Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Note: The input is…
Lintcode-背包问题IX
题目 You have a total of 10 * n thousand yuan, hoping to apply for a university abroad. The application is requi…
2018-01-28 C++set的使用
1、定义和初始化 set<int> S; set<int> S(S1); vector<int> ivec({0,1,2,3,4,5,5,4,3,2,1,0}); set<int…
LeetCode[21] - Encode and Decode Strings
不难,但是要考虑好如何handle “”。 因为平时都把“” 当做Null对待,这里就犯浑了。 这题,要把Null特别mark一下为‘NULL’,而特别处理 “” empty string. /*…
LeetCode[20] - Binary Tree Longest Consecutive Sequence
屌炸天的4行代码。 我洋洋洒洒那么多行,最后还不work.看了solution, 如此精简。 主要想法: Recursive用好。首先在这个level比一比,可否成。 不成的话,另立门户。 然后左右开弓。再把结果拿过来比…