摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan... 阅读全文
posted @ 2015-04-08 23:07 打小孩 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 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-08 22:14 打小孩 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Write a program to find the node at which the intersection of two singly linked lists begins.For example, the following two linked lists: A: ... 阅读全文
posted @ 2015-04-08 21:34 打小孩 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Compare two version numbers version1 and version2.If version1 > version2 return 1, if version1 v2[i])16 return 1;17 else... 阅读全文
posted @ 2015-04-08 20:51 打小孩 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the ... 阅读全文
posted @ 2015-04-08 20:05 打小孩 阅读(112) 评论(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-08 19:04 打小孩 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Related to question Excel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A... 阅读全文
posted @ 2015-04-08 17:54 打小孩 阅读(99) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return the number of trailing zeroes in n!.Note: Your solution should be in logarithmic time complexity.Credits:Special thanks to ... 阅读全文
posted @ 2015-04-08 17:33 打小孩 阅读(81) 评论(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].Note:... 阅读全文
posted @ 2015-04-08 16:46 打小孩 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thought about this?Here are ... 阅读全文
posted @ 2015-04-08 16:11 打小孩 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return... 阅读全文
posted @ 2015-04-08 15:39 打小孩 阅读(128) 评论(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-04-08 10:48 打小孩 阅读(95) 评论(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-04-08 10:27 打小孩 阅读(114) 评论(0) 推荐(0) 编辑