字符串
文章平均质量分 78
哎-哭泣的鱼
这个作者很懒,什么都没留下…
展开
-
【LeetCode】Length of Last Word
Length of Last Word Total Accepted: 20470 Total Submissions: 69655 My SubmissionsGiven a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last w原创 2014-10-10 17:38:26 · 625 阅读 · 0 评论 -
【LeetCode】Reverse Words in a String
Reverse Words in a String Total Accepted: 357 Total Submissions: 2355 My SubmissionsGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blu原创 2014-03-07 17:29:24 · 1109 阅读 · 0 评论 -
【LeetCode】Interleaving String && CSDN 交替字符串
1、Interleaving StringTotal Accepted: 6431 Total Submissions: 34519 My SubmissionsGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",原创 2014-03-29 14:54:31 · 1790 阅读 · 2 评论 -
【LeetCode】ZigZag Conversion
ZigZag Conversion Total Accepted: 5118 Total Submissions: 22667 My SubmissionsThe string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to displ原创 2014-03-15 18:01:04 · 815 阅读 · 0 评论 -
【LeetCode】Count and Say
Count and Say Total Accepted: 7984 Total Submissions: 30169 My SubmissionsThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off原创 2014-05-06 14:43:56 · 1783 阅读 · 0 评论 -
【九度】题目1485:W's Cipher
题目描述:Weird Wally's Wireless Widgets, Inc. manufactures an eclectic assortment of small, wireless, network capable devices, ranging from dog collars, to pencils, to fishing bobbers. All these devic原创 2013-12-27 17:20:16 · 936 阅读 · 0 评论 -
【九度】题目1054:字符串内排序
题目描述:输入一个字符串,长度小于等于200,然后将输出按字符顺序升序排序后的字符串。输入:测试数据有多组,输入字符串。输出:对于每组输入,输出处理后的结果。样例输入:bacd样例输出:abcd来源:2010年哈尔滨工业大学计算机研究生机试真题没有特别需要说明的,输入字符串排序。使用内置函数sort原创 2013-12-09 12:38:29 · 799 阅读 · 0 评论 -
【LeetCode】Longest Common Prefix
Longest Common Prefix Total Accepted: 4226 Total Submissions: 15745 My SubmissionsWrite a function to find the longest common prefix string amongst an array of strings.最直接的办法就是循环数组,依次迭代求最长前缀。不过这样会原创 2014-01-07 09:08:53 · 700 阅读 · 0 评论 -
【九度】题目1135:字符串排序
题目描述:先输入你要输入的字符串的个数。然后换行输入该组字符串。每个字符串以回车结束,每个字符串少于一百个字符。如果在输入过程中输入的一个字符串为“stop”,也结束输入。然后将这输入的该组字符串按每个字符串的长度,由小到大排序,按排序结果输出字符串。输入:字符串的个数,以及该组字符串。每个字符串以‘\n’结束。如果输入字符串为“stop”,也结束输入.原创 2013-12-09 15:52:45 · 1058 阅读 · 0 评论 -
【九度】题目1099:后缀子串排序
题目描述:对于一个字符串,将其后缀子串进行排序,例如grain其子串有:grain rain ain in n然后对各子串按字典顺序排序,即: ain,grain,in,n,rain输入:每个案例为一行字符串。输出:将子串排序输出样例输入:grain样例输出:aingrain原创 2013-12-09 13:14:47 · 976 阅读 · 0 评论