上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 28 下一页
摘要: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -... 阅读全文
posted @ 2015-06-07 18:58 TonyLuis 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer... 阅读全文
posted @ 2015-06-07 18:54 TonyLuis 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Given a range [m, n] where 0 >>=1; m>>>=1; count++; } return m<<count; } 阅读全文
posted @ 2015-06-07 18:42 TonyLuis 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Given 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 adjacen... 阅读全文
posted @ 2015-06-07 17:23 TonyLuis 阅读(461) 评论(0) 推荐(0) 编辑
摘要: Given 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 bottom. For exa... 阅读全文
posted @ 2015-06-07 17:12 TonyLuis 阅读(392) 评论(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 @ 2015-06-07 09:41 TonyLuis 阅读(307) 评论(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 32-bit i... 阅读全文
posted @ 2015-06-06 21:55 TonyLuis 阅读(310) 评论(0) 推荐(0) 编辑
摘要: Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return... 阅读全文
posted @ 2015-06-06 21:40 TonyLuis 阅读(202) 评论(0) 推荐(0) 编辑
摘要: Rotate 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].解题思路:... 阅读全文
posted @ 2015-06-06 21:32 TonyLuis 阅读(425) 评论(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 complet... 阅读全文
posted @ 2015-06-06 21:20 TonyLuis 阅读(270) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 28 下一页