https://loj.ac/problem/10045 题目描述 给出一个字符串,求最短循环节长度。 思路 KMP求最短循环节,跑一遍KMP即可。具体关于这个最短循环节的结论见Power Strings ...
分类:
其他好文 时间:
2019-10-04 22:46:51
阅读次数:
113
一. 函数名的运用 函数名是一个变量, 但它是一个特殊的变量, 与括号配合可以执行函数的变量 函数名的内存地址 函数名可以赋值给其他变量 函数名可以当做容器类的元素 函数名可以当做函数的参数 函数名可以作为函数的返回值 二.f strings字符串格式化 f strings 是python3.6开始 ...
分类:
其他好文 时间:
2019-10-03 18:00:02
阅读次数:
79
package mainimport ( "fmt" "net" "strings")func main() { listener, err := net.Listen("tcp", "127.0.0.1:8000") if err != nil { fmt.Println(err.Error()) ...
分类:
其他好文 时间:
2019-10-02 16:17:28
阅读次数:
128
题目如下: You are given two strings s and t of the same length. You want to change s to t. Changing the i-th character of s to i-th character of t costs | ...
分类:
其他好文 时间:
2019-10-02 10:27:08
阅读次数:
65
链接:https://codeforces.com/problemset/problem/1215/C Swap Letters (2 seconds) Monocarp has got two strings ss and tt having equal length. Both strings ...
分类:
其他好文 时间:
2019-10-01 13:51:50
阅读次数:
112
题目描述 Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need ...
分类:
其他好文 时间:
2019-09-30 23:35:43
阅读次数:
128
链接: https://vjudge.net/problem/HDU 1238 题意: You are given a number of case sensitive strings of alphabetic characters, find the largest string X, such ...
分类:
其他好文 时间:
2019-09-26 21:42:17
阅读次数:
94
func Random(strings []string) string { for i := len(strings) - 1; i > 0; i-- { num := rand.Intn(i + 1) strings[i], strings[num] = strings[num], string... ...
分类:
编程语言 时间:
2019-09-26 14:40:08
阅读次数:
146
Given an array of strings, group anagrams together. Example: All inputs will be in lowercase. The order of your output does not matter. 解法: 首先遍历输入,同时对 ...
分类:
其他好文 时间:
2019-09-23 11:38:29
阅读次数:
92
这是小川的第 412 次更新,第 444 篇原创 看题和准备 今天介绍的是 LeetCode 算法题中 Easy 级别的第 263 题(顺位题号是 1170 )。在一个非空字符串s上定义一个函数 ,该函数计算 中最小字符的出现频率。例如,如果 ,则 ,因为最小字符为 ,其频率为2。 现在,给定字符串 ...
分类:
其他好文 时间:
2019-09-23 09:55:24
阅读次数:
91