// JS截取字符串可使用 substring()或者slice() // // 函数:substring() // 定义:substring(start,end)表示从start到end之间的字符串,包括start位置的字符但是不包括end位置的字符。 // 功能:字符串截取,比如想从"Minid ...
分类:
Web程序 时间:
2020-01-08 10:27:01
阅读次数:
84
1.暴力法: 本题让求给定字符串的最长的无重复字符的子串,首先想到暴力解法,穷举出字符串的所有子串,并判断每个子串是否是不重复子串,具体使用hashset或set判是否有重复字符;暴力法效率很差,时间O(n^3),空间O(n);参考代码如下: 1 class Solution { 2 public: ...
分类:
其他好文 时间:
2020-01-07 13:27:01
阅读次数:
84
创建 随机字符串 sql substring(MD5(RAND()),1, 5) or DROP FUNCTION IF EXISTS ; delimiter $$ CREATE FUNCTION (n int) RETURNS varchar(255) CHARSET utf8 BEGIN DEC ...
分类:
其他好文 时间:
2020-01-07 10:26:03
阅读次数:
83
原题链接在这里:https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/ 题目: Find the length of the longest substring T of a give ...
分类:
其他好文 时间:
2020-01-06 15:00:54
阅读次数:
81
1. nullable string 从前 string 一定是 nullable. 现在则不一定 string? name = null; 要加 ? 才可以表示 nullable 2. range operation 以前最讨厌翻译 js -> c# 遇到 substring 因为 js 的 su ...
公司之前的项目里面的数据,名称后面有回车和换行符号 用下面的代码去掉了 realname是列名,这个函数在update语句中使用就可以了,就会删除掉回车换行符 字符串转日期类型 screenshot 是一个字段,字符串格式类似于20191122xxx.jpg之类的,用下面的方法可以转成datetim ...
分类:
数据库 时间:
2020-01-06 12:34:45
阅读次数:
109
如题,我们希望像gdb C程序一样。对python程序就行debug 可以使用pdb来实现这样的功能。 见:https://docs.python.org/3/library/pdb.html 最简单的方法,我们以 longest_substring.py 为例。 使用如下方式执行它,便进入了deb ...
分类:
数据库 时间:
2020-01-06 12:30:20
阅读次数:
100
link to problem Description: Given two strings text1 and text2, return the length of their longest common subsequence. A subsequence of a string is a ...
分类:
其他好文 时间:
2020-01-06 09:54:55
阅读次数:
84
/** * 687. Longest Univalue Path(最长的相同值路经) * https://leetcode.com/problems/longest-univalue-path/description/ * https://www.youtube.com/watch?v=yX1hVh ...
分类:
其他好文 时间:
2020-01-06 09:45:35
阅读次数:
79
题目大意:给定一棵树,每条边都有对应的权值,在树上找一条简单的路径,使得所有边权值的异或值最大。 分析:这个类似于前边写过的一个数组选定两个数的最大异或值,先dfs预处理一下从1到i的异或值D[i],然后当你想要取到s到e的异或值就是D[s]^D[e]。接下来就相当于之前写过的两个数的最大异或值问题 ...
分类:
其他好文 时间:
2020-01-05 18:45:16
阅读次数:
56