2016年9月11日

【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 医生工程师 阅读(191) 评论(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 医生工程师 阅读(83) 评论(0) 推荐(0) 编辑

2016年9月10日

【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 医生工程师 阅读(82) 评论(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 医生工程师 阅读(87) 评论(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 医生工程师 阅读(116) 评论(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 医生工程师 阅读(77) 评论(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 医生工程师 阅读(101) 评论(0) 推荐(0) 编辑

2016年9月7日

【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 医生工程师 阅读(165) 评论(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 医生工程师 阅读(91) 评论(0) 推荐(0) 编辑

2016年9月5日

[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 医生工程师 阅读(123) 评论(0) 推荐(0) 编辑

导航