LeetCode --- 201. Bitwise AND of Numbers Range May 3, 2015

 Tags LeetCode , C++ , 位操作

题目链接:Bitwise AND of Numbers RangeGiven a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.For exam... More »

0条评论

LeetCode --- 200. Number of Islands May 2, 2015

 Tags LeetCode , C++ , 深度优先搜索 , 广度优先搜索

题目链接:Number of IslandsGiven a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An island is surrounded by water and is formed by connecting ad... More »

0条评论

LeetCode --- 199. Binary Tree Right Side View May 1, 2015

 Tags LeetCode , C++ , , 深度优先搜索 , 广度优先搜索

题目链接:Binary Tree Right Side ViewGiven a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to ... More »

0条评论

LeetCode --- 198. House Robber May 1, 2015

 Tags LeetCode , C++ , 动态规划

题目链接:House RobberYou 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... More »

0条评论

LeetCode --- 191. Number of 1 Bits Apr 30, 2015

 Tags LeetCode , C++ , 位操作

题目链接:Number of 1 BitsWrite 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 32-b... More »

0条评论

LeetCode --- 190. Reverse Bits Apr 30, 2015

 Tags LeetCode , C++ , 位操作

题目链接:Reverse BitsReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return... More »

0条评论

LeetCode --- 189. Rotate Array Apr 29, 2015

 Tags LeetCode , C++ , 数组

题目链接:Rotate ArrayRotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].Note:... More »

0条评论

LeetCode --- 188. Best Time to Buy and Sell Stock IV Apr 29, 2015

 Tags LeetCode , C++ , 动态规划

题目链接:Best Time to Buy and Sell Stock IVSay 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 p... More »

0条评论

LeetCode --- 187. Repeated DNA Sequences Apr 28, 2015

 Tags LeetCode , C++ , Hash表 , 位操作

题目链接:Repeated DNA SequencesAll DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: “ACGAATTCCG”. When studying DNA, it is sometimes ... More »

0条评论

LeetCode --- 179. Largest Number Apr 27, 2015

 Tags LeetCode , C++ , 排序

题目链接:Largest NumberGiven a list of non negative integers, arrange them such that they form the largest number.For example, given [3, 30, 34, 5, 9], the largest formed ... More »

0条评论