Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the ...
分类:
其他好文 时间:
2018-12-09 16:45:36
阅读次数:
158
题目标签:String 利用left, right 两个pointers, 从左右开始 互换 字母。如果遇到的不是字母,那么继续移动到下一个。 Java Solution: Runtime beats 29.87% 完成日期:12/08/2018 关键点:two pointers 参考资料:N/A ...
分类:
其他好文 时间:
2018-12-09 10:41:57
阅读次数:
172
In a string S of lowercase letters, these letters form consecutive groups of the same character. For example, a string like S = "abbxxxxzyy" has the g ...
分类:
编程语言 时间:
2018-12-08 13:37:09
阅读次数:
131
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This ...
分类:
编程语言 时间:
2018-12-06 10:19:11
阅读次数:
242
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans ...
分类:
其他好文 时间:
2018-12-03 22:58:24
阅读次数:
230
Given a string s and a string t, check if s is subsequence of t. You may assume that there is only lower case English letters in both s and t. t is po ...
分类:
其他好文 时间:
2018-12-03 22:57:07
阅读次数:
222
Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at ...
分类:
其他好文 时间:
2018-12-03 22:56:29
阅读次数:
187
写一个函数,这个函数的功能是,传入一个数字,产生N条邮箱,产生的手机号不能重复。邮箱前面的长度是6 - 12之间,产生的邮箱必须包含大写字母、小写字母、数字和特殊字符 import random import s... ...
分类:
其他好文 时间:
2018-12-02 22:55:55
阅读次数:
386
如果要使用string模块,需要先导入该模块 import string string.ascii_lowercase #打印所有的小写字母 string.ascii_uppercase #打印所有的大写字母 string.ascii_letters #打印所有的大小写字母 string.digit ...
分类:
编程语言 时间:
2018-12-01 20:22:08
阅读次数:
246
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the rans ...
分类:
编程语言 时间:
2018-12-01 13:06:51
阅读次数:
171