摘要: 字符串经常出现括号的问题,主要就是产生括号对、判断括号对是否有效、最长的括号对子串。 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For 阅读全文
posted @ 2017-05-27 22:35 wxquare 阅读(426) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 int romanToInt(string s) { 4 unordered_map m; 5 m['I'] = 1; 6 m['V'] = 5; 7 m['X'] = 10; 8 m['L'] = 50; 9 m... 阅读全文
posted @ 2017-05-27 11:50 wxquare 阅读(268) 评论(0) 推荐(0) 编辑
摘要: Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-neg 阅读全文
posted @ 2017-05-27 11:30 wxquare 阅读(297) 评论(0) 推荐(0) 编辑
摘要: Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified. You shou 阅读全文
posted @ 2017-05-27 11:22 wxquare 阅读(250) 评论(0) 推荐(0) 编辑
摘要: Given an absolute path for a file (Unix-style), simplify it. For example,path ="/home/", =>"/home"path ="/a/./b/../../c/", =>"/c" click to show corner 阅读全文
posted @ 2017-05-27 11:17 wxquare 阅读(261) 评论(0) 推荐(0) 编辑
摘要: Implement wildcard pattern matching with support for'?'and'*'. 阅读全文
posted @ 2017-05-27 11:06 wxquare 阅读(339) 评论(0) 推荐(0) 编辑
摘要: mplement regular expression matching with support for'.'and'*'. 阅读全文
posted @ 2017-05-27 10:54 wxquare 阅读(589) 评论(0) 推荐(0) 编辑