Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie...
分类:
其他好文 时间:
2014-09-07 13:24:55
阅读次数:
229
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana...
分类:
其他好文 时间:
2014-09-07 12:15:55
阅读次数:
292
Unique Paths:
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).
The robot can only move either down or right at any point in time. The robot is t...
分类:
其他好文 时间:
2014-09-06 22:37:14
阅读次数:
246
打包之前在Android的Player Setting里面选择WriteAccess (写入访问)Internal Only:表示Application.persistentDataPath的路径是应用程序沙盒,(需要root不然访问不了写入的文件)文件路径:data/data/包名/Files/O...
分类:
移动开发 时间:
2014-09-05 19:53:11
阅读次数:
1266
// do bank 1 stuff, packet filter: // For broadcast packets we allow only ARP packtets // All other packets should be unicast only for our mac (MAADR....
分类:
其他好文 时间:
2014-09-05 19:40:31
阅读次数:
257
Sum Root to Leaf Numbers
Total Accepted: 20237 Total
Submissions: 67979My Submissions
Given a binary tree containing digits from 0-9 only,
each root-to-leaf path could represent a numbe...
分类:
其他好文 时间:
2014-09-05 16:12:01
阅读次数:
200
sed 命令可以很好的进行行匹配,但从某一行中精确匹配某些内容,则使用 grep 命令并辅以 -o 和 -E 选项可达到此目的。其中 -o 表示“only-matching”,即“仅匹配”之意。光用它不够,配合 -E 选项使用扩展正则表达式则威力巨大。比如下面有一条文本 tmp.txt ,其中内容为...
分类:
其他好文 时间:
2014-09-05 15:57:31
阅读次数:
273
安装httpd#mkdir/mnt/cdrom/#mount/dev/cdrom/mnt/cdrom/mount:/dev/sr0iswrite-protected,mountingread-only#cd/mnt/cdrom/Packages/#lshttpd*httpd-2.4.6-17.el7.centos.1.x86_64.rpmhttpd-devel-2.4.6-17.el7.centos.1.x86_64.rpmhttpd-manual-2.4.6-17.el7.centos.1.noarch..
分类:
其他好文 时间:
2014-09-05 03:20:51
阅读次数:
456
There are only two hard things in Computer Science: cache invalidation and naming things.在计算机科学中只有两件难事:缓存失效和命名。— Phil Karlton计算机语言是人和计算机之间通讯的媒介。好的代码应该...
分类:
其他好文 时间:
2014-09-05 00:52:00
阅读次数:
259
bool helper(TreeNode *pA, TreeNode *pB) { if (!pA && !pB) return true; if (!pA || !pB) return false; // only one has node in a tree and...
分类:
其他好文 时间:
2014-09-04 23:36:10
阅读次数:
308