LeetCode
half1_2_1
这个作者很懒,什么都没留下…
展开
-
LeetCode263: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 example, 6, 8 are ugly while 14 is not ugly since it原创 2015-08-21 15:53:22 · 440 阅读 · 0 评论 -
LeetCode258: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 like: 3 + 8 = 11, 1 + 1 = 2. Since 2 has only one原创 2015-08-21 16:20:36 · 578 阅读 · 0 评论 -
LeetCode203: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 --> 2 --> 3 --> 4 --> 5解法思路:在链表头添加一个结点,对链表进原创 2015-11-17 17:56:28 · 311 阅读 · 0 评论 -
LeetCode237:Delete Node in a Linked List
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 -> 3 -> 4 and you are given the third node with value原创 2015-11-17 17:15:57 · 284 阅读 · 0 评论