判断括号是否合法 1.用stack存入左括号“([{”,遇到相应的右括号“)]}”就退栈 2.判断stack是否为空,可以判断是否合法
分类:
其他好文 时间:
2016-03-16 20:44:38
阅读次数:
109
Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = "anagram", t = "nagaram", return true. s = "rat", t
分类:
其他好文 时间:
2016-03-15 20:29:14
阅读次数:
135
Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t =
分类:
其他好文 时间:
2016-03-13 12:44:43
阅读次数:
171
Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true Note: It is intended for the
分类:
其他好文 时间:
2016-03-13 00:28:16
阅读次数:
161
功能:复制一个文件描述符 #include <unistd.h> int dup(int oldfd); int dup2(int oldfd , int newfd); dup:不是原子操作 dup2:是原子操作 If oldfd is not a valid file descriptor, t
分类:
其他好文 时间:
2016-03-11 17:01:27
阅读次数:
186
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo
分类:
其他好文 时间:
2016-03-05 13:13:37
阅读次数:
137
idea 运行正常打成jar包运行提示“connect: Address is invalid on local machine or port is not valid on remote” , 解决方法: public static void main(String[] args) throws
分类:
系统相关 时间:
2016-03-04 21:03:49
阅读次数:
772
原题链接在这里:https://leetcode.com/problems/graph-valid-tree/ 题目: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair
分类:
其他好文 时间:
2016-03-03 13:02:17
阅读次数:
172
Given a string containing only digits, restore it by returning all possible valid IP address combinations. For example: Given "25525511135", return ["
分类:
其他好文 时间:
2016-03-02 15:05:51
阅读次数:
144