摘要: You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ve 阅读全文
posted @ 2016-11-21 00:21 JavaNerd 阅读(491) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Note: Exam 阅读全文
posted @ 2016-11-17 20:30 JavaNerd 阅读(241) 评论(0) 推荐(0) 编辑
摘要: Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits in ascending order. Note: Example 1: Examp 阅读全文
posted @ 2016-11-17 12:33 JavaNerd 阅读(199) 评论(0) 推荐(0) 编辑
摘要: There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the hor 阅读全文
posted @ 2016-11-16 10:36 JavaNerd 阅读(277) 评论(0) 推荐(0) 编辑
摘要: Given a set of intervals, for each of the interval i, check if there exists an interval j whose start point is bigger than or equal to the end point o 阅读全文
posted @ 2016-11-14 10:55 JavaNerd 阅读(397) 评论(0) 推荐(0) 编辑
摘要: A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the 阅读全文
posted @ 2016-11-13 15:35 JavaNerd 阅读(378) 评论(0) 推荐(0) 编辑
摘要: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals 阅读全文
posted @ 2016-11-13 10:10 JavaNerd 阅读(973) 评论(0) 推荐(0) 编辑
摘要: 最近的一个项目是写一个爬虫框架,这个框架主要采用Master-Slave的结构,Master负责管理要爬取的Url和已经爬取过的Url,Slave可以有多个,主要负责爬取网页内容,以及对爬取下来的网页内容进行持久化的工作。整个项目用Thrift作为RPC通信框架。1. 爬虫流程如果是一个单机版的爬虫... 阅读全文
posted @ 2016-01-12 09:12 JavaNerd 阅读(4296) 评论(3) 推荐(5) 编辑
摘要: vertica是惠普公司推出的列式分布式数据库,在OLAP领域有其独到的地方,目前社区版免费,但是只能存放1T的数据。我在工作中维护的bi系统后端就是使用的vertica数据库,平时也经常需要对于数据库的查询进行一些优化。所以写下这篇博客记录一下。定位问题所谓的数据库调优、程序优化之类的工作,实际上... 阅读全文
posted @ 2015-07-24 10:26 JavaNerd 阅读(7038) 评论(2) 推荐(1) 编辑
摘要: 今天碰到了一道面试题:原题大致是,每首歌曲都是一个评分,现在有2000首歌曲,要求实现一个随机播放器,每首歌曲播放的概率应该正比于它的评分,例如评分9.1的歌曲,和评分7.9的歌曲,播放的次数应该是91:79。面试官给的答案是大致如此:先把评分从小到大排序,之后把根据每首歌的评分,生成一个半闭开区间... 阅读全文
posted @ 2015-05-14 22:05 JavaNerd 阅读(2334) 评论(3) 推荐(0) 编辑