摘要: 题目描述: Implement pow(x, n). 解题思路: 注意n可能是INT_MIN。 阅读全文
posted @ 2016-04-13 10:50 skycore 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may 阅读全文
posted @ 2016-04-06 21:39 skycore 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Given a collection of integers that might contain duplicates, nums, return all possible subsets. Note: Elements in a subset must be in non-desce 阅读全文
posted @ 2016-04-04 21:06 skycore 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words 阅读全文
posted @ 2016-03-30 23:10 skycore 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight). For example, the 3 阅读全文
posted @ 2016-03-30 21:24 skycore 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Given a set of distinct integers, nums, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution se 阅读全文
posted @ 2016-03-25 23:11 skycore 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is: 解题思路: 阅读全文
posted @ 2016-03-25 22:39 skycore 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its 阅读全文
posted @ 2016-03-23 20:13 skycore 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 题目描述: Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your 阅读全文
posted @ 2016-03-23 19:26 skycore 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 题目描述: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at 阅读全文
posted @ 2016-03-18 15:40 skycore 阅读(161) 评论(0) 推荐(0) 编辑