网址:https://leetcode.com/problems/longest-palindromic-substring/
题意:
找出最长回文字符串.
解法1:
自然是暴力枚举,把每一个元素从中间往左右遍历,如果是且是最长的存下字符串.
比如abccba.
定位元素是2->c.
找左1->b.不行
找右3->c.可以->找左右同时->找左右同时
找左右同时.不行
思路就是...
分类:
其他好文 时间:
2015-04-28 22:56:08
阅读次数:
218
网址:https://leetcode.com/problems/zigzag-conversion/
题意:
转换一种编码格式?类似于这种意思吧...
反正挺无聊的一题...找规律...模拟题
分析:
特别注意以下numRows等于1和字符串长度小于numRows
解法:
按照行列来划分,常规的就是满列,
非常规的就是每隔(numRows)就存在的(多余)值
代码:
http...
分类:
其他好文 时间:
2015-04-28 22:53:50
阅读次数:
177
Description:
Count the number of prime numbers less than a non-negative number, n
提示晒数法:
http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
https://primes.utm.edu/howmany.html
别人的代码:
...
分类:
其他好文 时间:
2015-04-28 22:49:39
阅读次数:
238
https://developer.apple.com/library/downloads/docset-index.dvtdownloadableindex找到里面的文档下载地址例如iOS 8.3的离线文档下载地址,把地址复制下来用迅雷下载就快多了https://devimages.apple.c...
分类:
其他好文 时间:
2015-04-28 22:35:42
阅读次数:
250
在国内下载Android可是不太容易,不过从Google断断续续地下载了几天源码后发现清华大学有个TUNA镜像源可以下载Android源码,甚是方便。
参考网站:
http://source.android.com/index.html
https://aosp.tuna.tsinghua.edu.cn/
一.环境准备:
现在Android源码的下载和编译在...
分类:
移动开发 时间:
2015-04-28 21:07:53
阅读次数:
346
Demo:http://7li.github.io/components/modal/
Repo: https://github.com/7LI/swipe
/***********************************************************************
Modal component
@author lyz
@opt...
分类:
移动开发 时间:
2015-04-28 21:07:47
阅读次数:
262
题目来自于LeetCode
https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
...
分类:
其他好文 时间:
2015-04-28 21:07:40
阅读次数:
137
网址:https://leetcode.com/problems/median-of-two-sorted-arrays/
题意:
给了两组有序数,找出他们总的中位数
提示:
中位数是左右相等数目数的值,如果不存在,则取左右相等数目数的两个数的平均值.
解法1:
把两组数合并成一组数.也可以是O(m+n).
但空间复杂度是O(m+n).
明显有更好的解法.
解法2:
因为两组数...
分类:
其他好文 时间:
2015-04-28 21:06:58
阅读次数:
119
此文章主要是脚本示例,更多说明看官方文档:审核(数据库引擎)
-- 必须在 master 数据库中创建审核
USE master;
GO
-- 创建服务器审核对象
-- https://msdn.microsoft.com/zh-cn/library/cc280448(v=sql.100).aspx
CREATE SERVER AUDIT [Audit_ToFile]
TO FILE...
分类:
数据库 时间:
2015-04-28 21:06:28
阅读次数:
265
在php.ini里面添加下面两行,注意这两行的顺序一定不要颠倒(扩展库下载网址https://github.com/phpredis/phpredis/downloads),同时注意这2个文件的版本一定要与php的版本一致extension=php_igbinary.dllextension=php...
分类:
Web程序 时间:
2015-04-28 20:47:14
阅读次数:
168