摘要: After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attention. This t 阅读全文
posted @ 2016-12-16 05:22 lettuan 阅读(187) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, 阅读全文
posted @ 2016-12-15 14:24 lettuan 阅读(179) 评论(0) 推荐(0) 编辑
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2016-12-15 12:47 lettuan 阅读(155) 评论(0) 推荐(0) 编辑
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping yo 阅读全文
posted @ 2016-12-15 06:54 lettuan 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According 阅读全文
posted @ 2016-12-15 05:42 lettuan 阅读(317) 评论(0) 推荐(0) 编辑
摘要: Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. Exampl 阅读全文
posted @ 2016-12-13 13:59 lettuan 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Given an integer, write a function to determine if it is a power of two. Hint: 最容易想到的方法是用n反复的去除以2,一直到n变成1。这期间如果出现不能被2整除的数,那么一开始的n就不是2的power. 但是为了满足O(1 阅读全文
posted @ 2016-12-13 13:18 lettuan 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 实现Pow(x, n), 使用二分n的办法进行递归。 阅读全文
posted @ 2016-12-13 13:00 lettuan 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
posted @ 2016-12-13 03:48 lettuan 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin to in 阅读全文
posted @ 2016-12-13 03:42 lettuan 阅读(199) 评论(0) 推荐(0) 编辑