1 匹配首尾空格的正则表达式:(^\s*)|(\s*$) 2 整数或者小数:^[0-9]+\.{0,1}[0-9]{0,2}$ 3 只能输入数字:"^[0-9]*$"。 4 只能输入n位的数字:"^\d{n}$"。 5 只能输入至少n位的数字:"^\d{n,}$"。 6 只能输入m~n位的数字:。"... ...
分类:
编程语言 时间:
2019-10-16 13:20:43
阅读次数:
468
Given a string s , find the length of the longest substring t that contains at most 2 distinct characters. Example 1: Example 2: ...
分类:
其他好文 时间:
2019-10-15 10:15:53
阅读次数:
83
【转】Python3中遇到UnicodeEncodeError: 'ascii' codec can't encode characters in ordinal not in range(128) 现象 打印任何一种包含有中文的对象,字典、列表、DataFrame、或字符串。比如: 控制台报错: ...
分类:
编程语言 时间:
2019-10-15 09:22:07
阅读次数:
97
问题描述 The "BFS" algorithm is defined as follows. 1. Consider an undirected graph with vertices numbered from 11 to n. Initialize q as a new "queue" con ...
分类:
其他好文 时间:
2019-10-15 00:18:26
阅读次数:
98
异常:Invalid character found in the request target. The valid characters are defined in RFC 3986 ...
分类:
其他好文 时间:
2019-10-13 20:44:39
阅读次数:
113
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example: Note: If there i ...
一般来讲,对一些post请求,我们可以使用@valid+javax.validation.constraints包下注解的方式,优雅把参数验证放在control层的requst中,举例说明如下图: 但是此时,如果我们知道可以修改的状态只能为枚举类中存在的值,并没有已有的注解可以用,我们可以采用以下代 ...
分类:
编程语言 时间:
2019-10-12 01:11:39
阅读次数:
1018
这是在Win10系统下,将Jar包手工导入进Maven本地仓库,使用PowerShell执行命令报的错。 命令如下: 原因是在PowerShell中,点 “.” 算特殊运算符,导致该错误。 解决方法一:在CMD中执行该命令。需要注意把当前目录转到pom.xml所在目录 解决方法二:为命令加上单引号, ...
分类:
编程语言 时间:
2019-10-09 23:58:45
阅读次数:
257
D. Distinct Characters Queries time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are g ...
分类:
其他好文 时间:
2019-10-07 21:11:46
阅读次数:
200
File Upload: A file is a series of characters. Uploading a file is the opposite of downloading a file. Therefore to transfer a file we need to: 1. Rea ...
分类:
编程语言 时间:
2019-10-07 11:18:32
阅读次数:
84