# coding:utf-8 ''' 解释:对于两个字符串A 和B,如果A 和B 中出现的字符种类相同且每种字符出现的次数相同,则A 和 B 互为变形词,检查两给定串是否互为变形词。 题目:给定两个字符串 A 和 B 及他们的长度,请返回一个 bool 值,代表他们是否互为变形词。 测试样例: “abc”,3,”bca”,3 返回: True ''' def f(s)... Read More
posted @ 2019-07-25 08:56 笨笨的妞 Views(202) Comments(0) Diggs(0) Edit
# coding:utf-8 def find_longest_no_repeat_substr(one_str): ''''' 找出来一个字符串中最长不重复子串 ''' res_list = [] length = len(one_str) for i in range(length):#分别以字符串的每个字符作为自串的第一个字符 ... Read More
posted @ 2019-07-25 08:45 笨笨的妞 Views(845) Comments(0) Diggs(0) Edit