摘要:
Validate if a given string is numeric.Some examples:"0"=>true" 0.1 "=>true"abc"=>false"1 a"=>false"2e10"=>trueNote:It is intended for the problem stat... 阅读全文
摘要:
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.分析:此题的题意不是很明确,意思重新表述应该是一组string里面,有几个... 阅读全文
摘要:
Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subsequence of a string is a new string which is formed from the orig... 阅读全文
摘要:
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.分析:这道题参考leetcode.pdf的解法,代码简洁,处理的巧妙。值得借鉴的几点如下... 阅读全文
摘要:
Givens1,s2,s3, find whethers3is formed by the interleaving ofs1ands2.For example,Given:s1="aabcc",s2="dbbca",Whens3="aadbbcbcac", return true.Whens3="... 阅读全文
摘要:
Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe... 阅读全文
摘要:
Write a function to find the longest common prefix string amongst an array of strings.分析:这道题没什么好方法,暴力搜索比较即可,在用C++实现时有一个小trick就是"Ifposis equal to thest... 阅读全文
摘要:
Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa... 阅读全文
摘要:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文