随笔分类 -  Leetcode

上一页 1 ··· 15 16 17 18 19
摘要:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes... 阅读全文
posted @ 2015-04-12 13:02 amazingzoe 阅读(94) 评论(0) 推荐(0)
摘要:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321此题注意边界条件 -2^31 v;12 while(x){13 v.push_bac... 阅读全文
posted @ 2015-04-12 11:20 amazingzoe 阅读(207) 评论(0) 推荐(0)
摘要:The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read off as"tw... 阅读全文
posted @ 2015-04-10 21:57 amazingzoe 阅读(204) 评论(0) 推荐(0)
摘要:Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2015-04-10 21:00 amazingzoe 阅读(146) 评论(0) 推荐(0)
摘要:Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-04-10 20:06 amazingzoe 阅读(139) 评论(0) 推荐(0)
摘要:Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Solution1: 1 class Solution {... 阅读全文
posted @ 2015-04-10 18:56 amazingzoe 阅读(158) 评论(0) 推荐(0)
摘要:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the correct ... 阅读全文
posted @ 2015-04-10 16:22 amazingzoe 阅读(138) 评论(0) 推荐(0)
摘要:Description:You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint... 阅读全文
posted @ 2015-04-08 19:43 amazingzoe 阅读(119) 评论(0) 推荐(0)
摘要:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ... 阅读全文
posted @ 2015-04-08 19:37 amazingzoe 阅读(97) 评论(0) 推荐(0)

上一页 1 ··· 15 16 17 18 19