09 2016 档案

【LeetCode】172. Factorial Trailing Zeroes 解题小结
摘要:题目: Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 这题主要是计算n!中有多少个5存在,有5 阅读全文

posted @ 2016-09-25 22:58 医生工程师 阅读(184) 评论(0) 推荐(0)

[LeetCode]383. Ransom Note 解题小结
摘要:题目: Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the 阅读全文

posted @ 2016-09-19 05:12 医生工程师 阅读(224) 评论(0) 推荐(0)

【LeetCode】28. Implement strStr() 解题小结
摘要:题目: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 简单题。 阅读全文

posted @ 2016-09-12 23:34 医生工程师 阅读(174) 评论(0) 推荐(0)

【LeetCode】344. Reverse String
摘要:题目: Write a function that takes a string as input and returns the string reversed. Example:Given s = "hello", return "olleh". 应该说还是比较简单的。 阅读全文

posted @ 2016-09-12 23:08 医生工程师 阅读(149) 评论(0) 推荐(0)

【LeetCode】345. Reverse Vowels of a String 解题小结
摘要:题目: Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Give 阅读全文

posted @ 2016-09-12 23:02 医生工程师 阅读(124) 评论(0) 推荐(0)

【LeetCode】168. Excel Sheet Column Title 解题小结
摘要:题目: Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example 简单题 阅读全文

posted @ 2016-09-11 11:49 医生工程师 阅读(165) 评论(0) 推荐(0)

【LeetCode】67. Add Binary 解题小结
摘要:题目: Given two binary strings, return their sum (also a binary string). For example,a = "11"b = "1"Return "100". 阅读全文

posted @ 2016-09-11 11:20 医生工程师 阅读(229) 评论(0) 推荐(0)

【LeetCode】204. Count Primes 解题小结
摘要:题目: Description: Count the number of prime numbers less than a non-negative number, n. 这个题目有提示,计算素数的方法应该不用多说。 阅读全文

posted @ 2016-09-11 10:00 医生工程师 阅读(120) 评论(0) 推荐(0)

【LeetCode】223. Rectangle Area 解题小结
摘要:题目: Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined by its bottom left corner and top right corner 阅读全文

posted @ 2016-09-11 09:18 医生工程师 阅读(184) 评论(0) 推荐(0)

【LeetCode】171. Excel Sheet Column Number 解题小结
摘要:题目: Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example 阅读全文

posted @ 2016-09-11 08:51 医生工程师 阅读(213) 评论(0) 推荐(0)

【LeetCode】258. Add Digits 解题小结
摘要:题目: Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. For example: Given num = 38, the process is l 阅读全文

posted @ 2016-09-11 08:18 医生工程师 阅读(98) 评论(0) 推荐(0)

【LeetCode】263. Ugly Number
摘要:题目: Write a program to check whether a given number is an ugly number. Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For 阅读全文

posted @ 2016-09-10 15:30 医生工程师 阅读(95) 评论(0) 推荐(0)

【LeetCode】9. Palindrome Number
摘要:题目: Determine whether an integer is a palindrome. Do this without extra space. 简单题。看到两个比较好的解法,一个是把数字转化为字符串,然后首尾对比,往中间靠。另一种是数字分别从两头求和(保留位数:*10 + 余数),如果 阅读全文

posted @ 2016-09-10 10:43 医生工程师 阅读(101) 评论(0) 推荐(0)

【LeetCode】8. String to Integer (atoi)
摘要:题目: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see be 阅读全文

posted @ 2016-09-10 10:21 医生工程师 阅读(132) 评论(0) 推荐(0)

【LeetCode】7. Reverse Integer
摘要:题目 Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 简单题,需要考虑两个问题,1)如果输入的末尾是0怎么办?2)如果倒过来的数字溢出了怎么办? 阅读全文

posted @ 2016-09-10 08:47 医生工程师 阅读(88) 评论(0) 推荐(0)

【LeetCode】231. Power of Two
摘要:题目: Given an integer, write a function to determine if it is a power of two. 非常简单的一道题目 阅读全文

posted @ 2016-09-10 08:14 医生工程师 阅读(117) 评论(0) 推荐(0)

【LeetCode】 19. Remove Nth Node From End of List 解题小结
摘要:题目: Given a linked list, remove the nth node from the end of list and return its head. For example, 首先容易想到的是先遍历一次链表,计算链表长度L,然后再次遍历到L-n的位置删除结点。更好的办法是应用 阅读全文

posted @ 2016-09-07 12:16 医生工程师 阅读(180) 评论(0) 推荐(0)

【LeetCode】21. Merge Two Sorted Lists 解题小结
摘要:题目: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 lis 相对还是简单的, 阅读全文

posted @ 2016-09-07 11:04 医生工程师 阅读(106) 评论(0) 推荐(0)

[LeetCode] 237. Delete Node in a Linked Lis解题小结
摘要:题目: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 阅读全文

posted @ 2016-09-05 23:36 医生工程师 阅读(142) 评论(0) 推荐(0)

[LeetCode]24. Swap Nodes in Pairs
摘要:题目: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Yo 阅读全文

posted @ 2016-09-05 21:49 医生工程师 阅读(139) 评论(0) 推荐(0)

[LeetCode]160. Intersection of Two Linked Lists
摘要:题目: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: 判断两个链表是 阅读全文

posted @ 2016-09-05 21:04 医生工程师 阅读(114) 评论(0) 推荐(0)

[LeetCode]206. Reverse Linked List 解题小结
摘要:题目: Reverse a singly linked list. click to show more hints. Hint: A linked list can be reversed either iteratively or recursively. Could you implement 阅读全文

posted @ 2016-09-04 16:54 医生工程师 阅读(125) 评论(0) 推荐(0)

[LeetCode]203. Remove Linked List Elements 解题小结
摘要:题目: Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 阅读全文

posted @ 2016-09-04 10:51 医生工程师 阅读(150) 评论(0) 推荐(0)

[LeetCode] 83. Remove Duplicates from Sorted List
摘要:题目: Given a sorted linked list, delete all duplicates such that each element appear only once. For example,Given 1->1->2, return 1->2.Given 1->1->2->3 阅读全文

posted @ 2016-09-04 10:19 医生工程师 阅读(158) 评论(0) 推荐(0)

[Leetcode]141. Linked List Cycle
摘要:题目: Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? 让head不断走一步,如果cur不为null,走两步,这样如果存在cy 阅读全文

posted @ 2016-09-04 09:29 医生工程师 阅读(81) 评论(0) 推荐(0)

【LeetCode】389. Find the Difference
摘要:题目: Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter 阅读全文

posted @ 2016-09-02 14:13 医生工程师 阅读(191) 评论(0) 推荐(0)

【LeetCode】202. Happy Number
摘要:题目: Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive in 阅读全文

posted @ 2016-09-02 11:41 医生工程师 阅读(156) 评论(0) 推荐(0)

导航