摘要: 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-09-15 15:19 Machelsky 阅读(143) 评论(0) 推荐(0)
摘要: Given an integer, write a function to determine if it is a power of two. Solution1: 检查1的个数,略麻烦。 Solution2: 清零法,跟之前有一道题目很像 阅读全文
posted @ 2016-09-15 14:58 Machelsky 阅读(129) 评论(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-09-15 12:38 Machelsky 阅读(103) 评论(0) 推荐(0)
摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文
posted @ 2016-09-15 12:25 Machelsky 阅读(102) 评论(0) 推荐(0)
摘要: Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the 阅读全文
posted @ 2016-09-15 11:39 Machelsky 阅读(137) 评论(0) 推荐(0)