码迷,mamicode.com
首页 >  
搜索关键字:strings    ( 3278个结果
Anagrams
题目 Given an array of strings, return all groups of strings that are anagrams. Note: All inputs will be in lower-case. 方法 题目中是找出所有的字符串由相同的字符组成,只是顺序不同。 public List anagrams(St...
分类:其他好文   时间:2014-06-19 10:46:45    阅读次数:207
每日算法之三十四:Multiply Strings
大数相乘,分别都是用字符串表示的两个大数,求相乘之后的结果表示。 首先我们应该考虑一下测试用例会有哪些,先准备测试用例对防御性编程会有比较大的帮助,能够考虑一些极端情况。有以下几种用例: 1)"0","0"   2)"0","879127346783" 其中一个是零 3)"as234","123343"  存在非法字符 4)"000000000000001234","2546"  存在零...
分类:其他好文   时间:2014-06-16 21:08:24    阅读次数:255
ruby 正则表达式Regexp
http://ruby-doc.org/core-2.1.2/Regexp.htmlRegexpARegexpholds a regular expression, used to match a pattern against strings. Regexps are created using ...
分类:其他好文   时间:2014-06-14 21:17:33    阅读次数:304
Multiply Strings
题目 Given two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 方法 将num1与0-9相乘的结果存...
分类:其他好文   时间:2014-06-14 06:08:30    阅读次数:229
[leetcode]Multiply Strings @ Python
原题地址:https://oj.leetcode.com/problems/multiply-strings/题意:Given two numbers represented as strings, return multiplication of the numbers as a string.N...
分类:编程语言   时间:2014-06-12 21:43:03    阅读次数:344
LeetCode: Anagrams 题解
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.题解: 判断字符串是否为回文构词法生成的。找出所有由同一回文构词法生成的字...
分类:其他好文   时间:2014-06-12 13:51:32    阅读次数:200
Add Binary
题目 Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 方法 从后往前,每个字符进行判断。 public String addBinary(String a, String...
分类:其他好文   时间:2014-06-10 17:50:48    阅读次数:241
[leetcode]Longest Common Prefix @ Python
原题地址:https://oj.leetcode.com/problems/longest-common-prefix/题意:Write a function to find the longest common prefix string amongst an array of strings.解...
分类:编程语言   时间:2014-06-10 16:31:52    阅读次数:261
leetcode -- 刷效率 Longest Common Prefix
题目描述: Write a function to find the longest common prefix string amongst an array of strings. 很简单的一道题目,但是我写了两个不一样的版本,运行时间确实数倍之差。。贴代码如下: 版本1: {CSDN:CODE:384511} 这个版本的运行时间为  44 ms...
分类:其他好文   时间:2014-06-10 08:18:58    阅读次数:291
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!