- 博客(7)
- 收藏
- 关注
原创 LeetCode | Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Have you thought about this? Here are some good questions to ask before coding. Bonus points for y
2014-12-27 15:41:59 328
原创 LeetCode | Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array.
2014-12-11 14:12:59 215
原创 LeetCode | Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follow up: Can you solve it without using extra space? /** * Definition for singly-linked list.
2014-12-05 11:32:04 262
原创 LeetCode | 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? tags提示:two pointers 采用“快慢双指针”的方法来判断: 每次slow_pointer前进一格,而fast_pointer前进两格,如若lis
2014-12-04 20:45:07 298
原创 LeetCode | Best Time to Buy and Sell Stock III
Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete at most two transactions. Note: You may not
2014-12-03 18:08:08 350
原创 LeetCode | Best Time to Buy and Sell Stock II
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie, buy on
2014-12-02 14:44:28 389
原创 LeetCode | Best Time to Buy and Sell Stock
Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock),
2014-12-01 13:42:41 245
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人