02 2016 档案

摘要:题目:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space 阅读全文
posted @ 2016-02-27 14:32 seyjs 阅读(163) 评论(0) 推荐(0)
摘要:awk的next相当于循环中continue的作用,next后面的语句将不再执行。 例如,下面的例子中,包含数字3的那行的print语句没有被执行。 [root]$ seq 5 | awk '{print $0}' 1 2 3 4 5 [root]$ seq 5 | awk '/3/ {next} 阅读全文
posted @ 2016-02-25 16:18 seyjs 阅读(702) 评论(0) 推荐(0)
摘要:例如:有一个文件test.txt,里面有这些数据。 meiguounix232 faguounix ribenunix zhongguounixtaobao hanguounixbaba 现在我想截取unix前面的数据,包含unix,并输出。 得到数据应该是: meiguounix faguouni 阅读全文
posted @ 2016-02-24 19:20 seyjs 阅读(1615) 评论(0) 推荐(0)
摘要:Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true if 阅读全文
posted @ 2016-02-18 15:53 seyjs 阅读(175) 评论(0) 推荐(0)