You are given a string,S, and a list of
words,L, that are all of the same length. Find all starting indices of
substring(s) in S that is a concatenati...
分类:
其他好文 时间:
2014-05-28 04:03:54
阅读次数:
240
题目链接题意: find the maximum positive difference
between the price on the ith day and the jth day附上代码: 1 class Solution { 2
public: 3 int maxProfit(ve...
分类:
其他好文 时间:
2014-05-28 03:49:45
阅读次数:
307
文件及目录管理文件管理不外乎文件或目录的创建、删除、查询、移动,有mkdir/rm/mv文件查询是重点,用find来进行查询;find的参数丰富,也非常强大;查看文件内容是个大的话题,文本的处理有太多的工具供我们使用,在本章中只是点到即止,后面会有专门的一章来介绍文本的处理工具;有时候,需要给文件创...
分类:
系统相关 时间:
2014-05-27 17:45:40
阅读次数:
435
You could use:Calendar c
=Calendar.getInstance();int seconds = c.get(Calendar.SECOND);There are plenty of
constants in Calendar for everything you nee...
分类:
移动开发 时间:
2014-05-27 17:13:56
阅读次数:
512
Given an array of integers, find two numbers such
that they add up to a specific target number.The function twoSum should return
indices of the two nu...
分类:
其他好文 时间:
2014-05-26 19:50:39
阅读次数:
314
1.php str_replace函数:str_replace()
函数使用一个字符串替换字符串中的另一些字符。str_replace(find,replace,string,count)find:必须,表示被查找的值replace:必须,替换别查找的值的值string:必须,被查找的字符串coun...
分类:
Web程序 时间:
2014-05-26 19:38:05
阅读次数:
292
出题:并查集(Union-Find
Sets)分析:一种树型数据结构,用于处理不相交集合(Disjoint
Sets)的合并以及查询;一开始让所有元素独立成树,也就是只有根节点的树;然后根据需要将关联的元素(树)进行合并;合并的方式仅仅是将一棵树最原始的节点的父亲索引指向另一棵树;优化:加入一个ra...
分类:
其他好文 时间:
2014-05-26 18:48:46
阅读次数:
290
Determine whether an integer is a palindrome. Do
this without extra space.Some hints:Could negative integers be palindromes? (ie,
-1)If you are thinki...
分类:
其他好文 时间:
2014-05-26 18:07:52
阅读次数:
217
在备份ltedecoder程序时,需要把此目录拷由到bak目录下,但decoder目录下有个大文件,不需要备份,还有日志问题,也不需要备份,如何实现呢??
方法:
cd /source-dir
find . -name .snapshot
-prune -o -print0 | cpio -pmd0 /dest-dir
解释: This command cop...
分类:
其他好文 时间:
2014-05-25 21:51:29
阅读次数:
518
原文:
Given an array of integers, every element appears twice except for one. Find that single one.
Note:
Your algorithm should have a linear runtime complexity. Could you implement it without ...
分类:
其他好文 时间:
2014-05-25 21:30:02
阅读次数:
276