上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 53 下一页
摘要: Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algori 阅读全文
posted @ 2017-01-09 11:40 北叶青藤 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 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 @ 2017-01-09 10:48 北叶青藤 阅读(167) 评论(0) 推荐(0) 编辑
摘要: From:http://bradforj287.blogspot.com/2010/11/efficient-circular-buffer-in-java.html 阅读全文
posted @ 2017-01-05 14:56 北叶青藤 阅读(284) 评论(0) 推荐(0) 编辑
摘要: This problem can be solved by using a heap. The time is O(nlog(n)). Given m arrays, the minimum elements of all arrays can form a heap. It takes O(log 阅读全文
posted @ 2017-01-05 08:52 北叶青藤 阅读(474) 评论(0) 推荐(0) 编辑
摘要: Part 1: 前言: 最近看了一些关于短址(short URL)方面的一些博客,有些博客说到一些好的东西,但是,也不是很全,所以,这篇博客算是对其它博客的一个总结吧。 介绍: 短址,顾名思义,就是把长的 URL 转成短的 URL, 现在提供这种服务的有很多公司,我们以google家的 URL sh 阅读全文
posted @ 2017-01-04 08:21 北叶青藤 阅读(527) 评论(0) 推荐(0) 编辑
摘要: Given a string representing arbitrarily nested ternary expressions, calculate the result of the expression. You can always assume that the given expre 阅读全文
posted @ 2017-01-03 10:36 北叶青藤 阅读(214) 评论(0) 推荐(0) 编辑
摘要: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total 阅读全文
posted @ 2017-01-03 10:07 北叶青藤 阅读(277) 评论(0) 推荐(0) 编辑
摘要: The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2017-01-03 09:58 北叶青藤 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Given a stream of integers and a window size, calculate the moving average of all integers in the sliding window. For example,MovingAverage m = new Mo 阅读全文
posted @ 2017-01-03 06:49 北叶青藤 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given an 2D board, count how many different battleships are in it. The battleships are represented with 'X's, empty slots are represented with '.'s. Y 阅读全文
posted @ 2017-01-03 00:20 北叶青藤 阅读(251) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 53 下一页