上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 46 下一页
摘要: Description:Count the number of prime numbers less than a non-negative number,nclick to show more hints.References:How Many Primes Are There?Sieve of ... 阅读全文
posted @ 2015-04-30 10:42 卖程序的小歪 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 这题居然没有记录,写一下吧:Given a set of candidate numbers (C) and a target number (T), find all unique combinations inCwhere the candidate numbers sums toT.Thesa... 阅读全文
posted @ 2015-04-25 17:30 卖程序的小歪 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2 --> 3 --... 阅读全文
posted @ 2015-04-25 09:40 卖程序的小歪 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 bool isHappy(int n) { 4 int last = n; 5 6 unordered_set exist; 7 8 do { ... 阅读全文
posted @ 2015-04-22 23:45 卖程序的小歪 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 虽然叫nc不过用起来非常方便。选项 -4 Use IPv4 only -6 Use IPv6 only -U, --unixsock... 阅读全文
posted @ 2015-04-21 10:21 卖程序的小歪 阅读(520) 评论(0) 推荐(0) 编辑
摘要: 这个题居然没有记录。原地旋转数组可以见编程珠玑,在JDK代码中也可以找到(Collections.rotate),提供了两种方式一种是做三次reverse,还有一种则是进行遍历替换。第一种方式: 1 class Solution { 2 public: 3 void rotate(int n... 阅读全文
posted @ 2015-04-20 11:02 卖程序的小歪 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 public: 3 int majorityElement(vector &num) { 4 int candidate = num[0]; 5 int count = 1; 6 int len = ... 阅读全文
posted @ 2015-04-19 23:11 卖程序的小歪 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1 class Solution { 2 private: 3 char tbl[256]; 4 public: 5 vector findRepeatedDnaSequences(string s) { 6 vector res; 7 8 ... 阅读全文
posted @ 2015-04-19 22:17 卖程序的小歪 阅读(149) 评论(0) 推荐(0) 编辑
摘要: tr命令可以用来做简单的字符替换与删除,常用的有-d, -s选项。它的替换与删除是按单个字符来的假设有以下文本:Read from the file words.txt and output the word frequency list to stdout.USE CASE 1:将文本全部转化为大... 阅读全文
posted @ 2015-04-17 14:48 卖程序的小歪 阅读(435) 评论(0) 推荐(0) 编辑
摘要: NAME uniq - report or omit repeated linesSYNOPSIS uniq [OPTION]... [INPUT [OUTPUT]]DESCRIPTION Filter adjacent matching lines from I... 阅读全文
posted @ 2015-04-16 16:55 卖程序的小歪 阅读(536) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 46 下一页