07 2015 档案

摘要:Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"].My Soluti... 阅读全文
posted @ 2015-07-29 23:40 irun 阅读(145) 评论(0) 推荐(0)
摘要:Description:Count the number of prime numbers less than a non-negative number,n.Hint:Let's start with aisPrimefunction. To determine if a number is pr... 阅读全文
posted @ 2015-07-28 23:02 irun 阅读(110) 评论(0) 推荐(0)
摘要:Given an integer, write a function to determine if it is a power of two.Solution:一个整数如果是2的整数次方,那么它的二进制表示中有且只有一位是1,而其他所有位都是0。把这个整数与这个整数减去1之后进行与运算,那么这个整... 阅读全文
posted @ 2015-07-27 23:04 irun 阅读(113) 评论(0) 推荐(0)
摘要:Given a stringsconsists of upper/lower-case alphabets and empty space characters' ', return the length of last word in the string.If the last word doe... 阅读全文
posted @ 2015-07-27 22:49 irun 阅读(122) 评论(0) 推荐(0)
摘要:7 - Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Notice:1.If the integer's last digit is 0, what should the ... 阅读全文
posted @ 2015-07-27 21:45 irun 阅读(174) 评论(0) 推荐(0)
摘要:237 -Delete Node in a Linked ListWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed ... 阅读全文
posted @ 2015-07-26 23:03 irun 阅读(176) 评论(0) 推荐(0)
摘要:You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb... 阅读全文
posted @ 2015-07-26 22:26 irun 阅读(127) 评论(0) 推荐(0)
摘要:9 - Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie,... 阅读全文
posted @ 2015-07-26 20:41 irun 阅读(161) 评论(0) 推荐(0)