Mike has n strings s1,?s2,?...,?sn each consisting of lowercase English letters. In one move he can choose a string si, erase the first character and ...
分类:
其他好文 时间:
2020-02-23 16:29:53
阅读次数:
69
Feb 17, 2020 ~ Feb 23, 2020 Algorithm Problem 205.Isomorphic Strings(同构字符串) "题目链接" 题目描述:给定两个字符串 s 和 t,判断是否可以通过字符替换从 s 得到 t。顺序不可以改变,同时不允许两个字符映射到同一个字符,但 ...
分类:
其他好文 时间:
2020-02-23 11:20:32
阅读次数:
73
函数组合运行 说明:实现一个方法,可将多个函数方法按从左到右的方式组合运行。 如composeFunctions(fn1,fn2,fn3,fn4)等价于fn4(fn3(fn2(fn1))。 1 const add = x => x + 1; 2 const multiply = (x, y) => ...
分类:
其他好文 时间:
2020-02-20 23:37:49
阅读次数:
120
假设s可以由t重复k次拼成,即s=tttt……tt,我们称为s=t^k。先给定一个字符串s,求最大的n使得存在t满足s=t^n。 用kmp的nxt数组解决~ #include<cstdio> #include<cstring> #include<iostream> using namespace s ...
分类:
其他好文 时间:
2020-02-19 21:07:08
阅读次数:
62
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concate ...
分类:
编程语言 时间:
2020-02-18 16:33:41
阅读次数:
88
1,如下定义的变量 b ,存储的就是字符串类型的值 b="hello" 或者 b='hello' 总结:双引号或者单引号中的数据,就是字符串 2,字符串输出 name=" lihua" print("姓名:%s " % name) 3,f-strings f-strings 提供一种简洁易读的方式, ...
分类:
其他好文 时间:
2020-02-17 21:25:03
阅读次数:
110
他的结构就是F+str 或者 f+str的形式,在字符串中想替换的位置用{}展位,与format类似,但是用在字符串后面写入替换的内容,而他可以直接识别 name = '小旋风' age = 18 sex = '男' msg = F'姓名:{name},性别:{age},年龄:{sex}' # 大写 ...
分类:
其他好文 时间:
2020-02-16 20:46:07
阅读次数:
63
传送门 A. Three Strings 题意:给三个长为n字符串a,b,c,需对字符串每一位都进行操作: i (1 ≤ i ≤ n ),ci?aior ci?bi,问是否能让a与b相等。 思路:对于每个i(1≤i≤n),其中n是字符串的长度。 如果ci等于ai,我们可以用bi交换它;如果ci等于b ...
分类:
其他好文 时间:
2020-02-16 17:58:08
阅读次数:
58
1 package info_websocket 2 3 import ( 4 "crypto/sha1" 5 "encoding/base64" 6 "errors" 7 "io" 8 "log" 9 "net" 10 "strings" 11 ) 12 13 func main() { 14 l ...
分类:
Web程序 时间:
2020-02-16 16:25:39
阅读次数:
93
[toc] ? 893. 特殊等价字符串组 https://leetcode cn.com/problems/groups of special equivalent strings 描述 ? 811. 子域名访问计数 https://leetcode cn.com/problems/subdoma ...
分类:
其他好文 时间:
2020-02-16 12:49:09
阅读次数:
92