摘要: Given an integern, return the number of trailing zeroes inn!.Note:Your solution should be in logarithmic time complexity.Credits:Special thanks to@tsf... 阅读全文
posted @ 2015-02-16 02:37 Sherry是小太阳 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321题目解析:你要是敢用string解你就输了!!一位一位运算吧骚年, 没啥好解释的, 注意overflow和负数情况就行~ 1 ... 阅读全文
posted @ 2015-02-15 11:29 Sherry是小太阳 阅读(95) 评论(0) 推荐(0) 编辑
摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2015-02-15 11:19 Sherry是小太阳 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2015-02-15 11:00 Sherry是小太阳 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?思路解析:这道题是一道比较经典的面试题啊~without using extra s... 阅读全文
posted @ 2015-02-15 03:26 Sherry是小太阳 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.题目解析:炒鸡简单... 阅读全文
posted @ 2015-02-15 00:07 Sherry是小太阳 阅读(106) 评论(0) 推荐(0) 编辑
摘要: Given a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After re... 阅读全文
posted @ 2015-02-14 03:14 Sherry是小太阳 阅读(116) 评论(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: a... 阅读全文
posted @ 2015-02-14 02:51 Sherry是小太阳 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the fol... 阅读全文
posted @ 2015-02-14 01:29 Sherry是小太阳 阅读(137) 评论(0) 推荐(0) 编辑
摘要: Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephon... 阅读全文
posted @ 2015-02-13 08:10 Sherry是小太阳 阅读(131) 评论(0) 推荐(0) 编辑