字符串匹配

正则表达式匹配‘.’ 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:     阅读全文
vhyz's avatar
vhyz 3月 31, 2018

LeetCode:括号匹配问题

简单括号的匹配Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are all valid but...     阅读全文
vhyz's avatar
vhyz 3月 31, 2018

最长回文字符串

Longest Palindromic SubstringGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000....     阅读全文
vhyz's avatar
vhyz 9月 23, 2017

判断是否为n的幂

231. Power of Two本题有四种思路,一种一种道来 循环class Solution { public: bool isPowerOfTwo(int n) { ...     阅读全文
vhyz's avatar
vhyz 7月 27, 2017

翻转问题

翻转数字问题7. Reverse Integer这道题知道原理会非常容易弄懂,值得注意是要注意溢出问题 贴上代码: class Solution{ public: in...     阅读全文
vhyz's avatar
vhyz 7月 26, 2017