Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. The matching should cover the entire ...
分类:
其他好文 时间:
2018-09-24 13:50:19
阅读次数:
156
Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. The matching should cover the entire ...
分类:
其他好文 时间:
2018-09-23 11:56:13
阅读次数:
177
思路 如果不用python自带的索引功能,就要遍历的时候进行比较,用切片会很方便 可以偷个懒用python的索引功能 代码 改进 index()方法会抛出异常,该用find()方法就不用考虑,find()方法失败的时候会返回 1 ...
分类:
编程语言 时间:
2018-09-22 12:41:46
阅读次数:
161
50. Pow(x, n) Implement pow(x, n), which calculates x raised to the power n (xn). Example 1: Input: 2.00000, 10 Output: 1024.00000 Example 2: Input: 2 ...
分类:
其他好文 时间:
2018-09-18 22:54:19
阅读次数:
178
题目: Implement strStr(). Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 返回haystack中第一次出现针的索引, ...
分类:
其他好文 时间:
2018-09-17 17:45:33
阅读次数:
128
Given a function rand7 which generates a uniform random integer in the range 1 to 7, write a function rand10 which generates a uniform random integer ...
分类:
其他好文 时间:
2018-09-16 12:35:06
阅读次数:
133
题目描述 Implement pow(x, n). AC: class Solution { public: double pow(double x, int n) { if(x == 0 && n == 0) return 1; if(x == 0) return 0; if(n == 0) re ...
分类:
其他好文 时间:
2018-09-15 23:50:18
阅读次数:
366
想起来记录一下自己对PHP的优化思路 针对Nginx和 PHP-FPM进行优化 首先应该分为代码层面、配置层面、架构层面 代码层面 参见了https://segmentfault.com/a/1190000009442044 这篇文章 1.减少PHP代码量 显而易见,PHP作为解释性语言,每次执行都 ...
分类:
Web程序 时间:
2018-09-11 21:15:14
阅读次数:
179
基于C语言中的sort如此这么方便,自然而然,java中也有类似C的sort函数。 1.普通数组:Arrays.sort(数组名,开始位置,结束位置)。 2.类中属性排序: 模板: class A { int n; } class cmp implement Comparator<A> { 升序: ...
分类:
编程语言 时间:
2018-09-11 14:01:53
阅读次数:
142
String相等 == 只是比较引用值就是地址如果是new String的话 例如substring跟其他的比较就要用str.equal() ...
分类:
其他好文 时间:
2018-09-07 23:53:21
阅读次数:
209