随笔分类 -  LeetCode 题目

171. Excel Sheet Column Number
摘要:Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A ... 阅读全文

posted @ 2015-04-13 08:26 shini 阅读(81) 评论(0) 推荐(0)

172. Factorial Trailing Zeroes
摘要:Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.cracking interview原题,2*5可以构成一... 阅读全文

posted @ 2015-04-13 08:24 shini 阅读(101) 评论(0) 推荐(0)

173. Binary Search Tree Iterator
摘要:Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文

posted @ 2015-04-09 11:57 shini 阅读(98) 评论(0) 推荐(0)

174. Dungeon Game
摘要:The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a... 阅读全文

posted @ 2015-04-09 11:47 shini 阅读(132) 评论(0) 推荐(0)

179. Largest Number
摘要:Given 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 num... 阅读全文

posted @ 2015-04-09 11:38 shini 阅读(99) 评论(0) 推荐(0)

187. Repeated DNA Sequences
摘要:All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to ... 阅读全文

posted @ 2015-04-09 11:29 shini 阅读(183) 评论(0) 推荐(0)

189. Rotate Array
摘要:Rotate an array ofnelements to the right byksteps.For example, withn= 7 andk= 3, the array[1,2,3,4,5,6,7]is rotated to[5,6,7,1,2,3,4].Note:Try to come... 阅读全文

posted @ 2015-04-08 07:37 shini 阅读(114) 评论(0) 推荐(0)

190. Reverse Bits
摘要:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ... 阅读全文

posted @ 2015-04-08 07:11 shini 阅读(103) 评论(0) 推荐(0)

191. Number of 1 Bits
摘要:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the 32-bit in... 阅读全文

posted @ 2015-04-08 07:04 shini 阅读(117) 评论(0) 推荐(0)

198. House Robber
摘要: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-04-08 06:59 shini 阅读(135) 评论(0) 推荐(0)

199. Binary Tree Right Side View
摘要:Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl... 阅读全文

posted @ 2015-04-08 06:51 shini 阅读(109) 评论(0) 推荐(0)

1. Two Sum
摘要:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文

posted @ 2015-04-07 11:53 shini 阅读(115) 评论(0) 推荐(0)

导航