Description A word consisting of lower-case letters of the English alphabet ('a'-'z') is given. We would like to choose a non-empty contiguous (i.e. o ...
分类:
其他好文 时间:
2017-10-20 18:26:20
阅读次数:
139
# 1、写一个产生密码的程序,# 输入次数,输入多少次就产生多少条数据,# 要求密码必须包含大写字母、小写字母和数字,长度8位,不能重复 1 import string ,random 2 num=input('请输入一个数字').strip() 3 pwds=set() #定义一个空集合 4 if... ...
分类:
编程语言 时间:
2017-10-20 10:17:00
阅读次数:
254
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 ...
分类:
其他好文 时间:
2017-10-19 21:17:44
阅读次数:
198
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho ...
分类:
其他好文 时间:
2017-10-17 17:25:31
阅读次数:
171
Find the length of the longest substring T of a given string (consists of lowercase letters only) such that every character in T appears no less than ...
分类:
其他好文 时间:
2017-10-17 15:15:41
阅读次数:
141
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 ...
分类:
其他好文 时间:
2017-10-17 12:36:55
阅读次数:
158
Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could ...
分类:
其他好文 时间:
2017-10-16 22:07:54
阅读次数:
98
Python3中String模块ascii_letters和digits方法,其中ascii_letters是生成所有字母,从a-z和A-Z,digits是生成所有数字0-9。 示例如下: Python >>> chars = string.ascii_letters + string.digits ...
分类:
其他好文 时间:
2017-10-16 16:51:49
阅读次数:
236
Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the ...
分类:
其他好文 时间:
2017-10-12 12:11:14
阅读次数:
186
String模块中的常量:string.digits:数字0~9string.letters:所有字母(大小写)string.lowercase:所有小写字母string.printable:可打印字符的字符串string.punctuation:所有标点string.uppercase:所有大写字 ...
分类:
编程语言 时间:
2017-10-11 21:53:31
阅读次数:
277