
leetcode
apple
这个作者很懒,什么都没留下…
展开
-
Leetcode习题: SingleNumber II
Single Number II AC Rate: 323/1255My SubmissionsGiven an array of integers, every element appears three times except for one. Find that single one.Note:Your algorithm should have原创 2013-10-04 11:35:40 · 2808 阅读 · 0 评论 -
Leetcode习题:Divide Two Integers
Divide Two Integers AC Rate: 770/5289My SubmissionsDivide two integers without using multiplication, division and mod operator.提交了几次,看似简单的一道题,第一下提交发现忘考虑负数的情况……以后做题一定要想清楚。第二次提原创 2013-10-08 23:45:14 · 2463 阅读 · 0 评论 -
Leetcode习题:Remove Nth Node From End of List
Remove Nth Node From End of List AC Rate: 1023/3385My SubmissionsGiven a linked list, remove the nth node from the end of list and return its head.For example, Given linked lis原创 2013-10-09 00:12:05 · 3069 阅读 · 0 评论 -
Leetcode习题:Convert Sorted List to Binary Search Tree
Convert Sorted List to Binary Search Tree AC Rate: 878/3476My SubmissionsGiven a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.原创 2013-10-10 22:13:34 · 2278 阅读 · 0 评论 -
Leetcode习题:Unique Binary Search Trees
Unique Binary Search Trees AC Rate: 1802/5241My SubmissionsGiven n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n = 3, ther原创 2013-10-23 23:14:43 · 866 阅读 · 0 评论 -
Leetcode习题-Reverse Integer
Reverse Integer AC Rate: 2538/6177My SubmissionsReverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thoug原创 2013-10-23 22:45:34 · 1091 阅读 · 0 评论 -
Leetcode 习题: Merge k Sorted Lists
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity./** * Definition for singly-linked list. * public class ListNode { * int val;原创 2014-05-23 08:16:51 · 691 阅读 · 0 评论 -
Leetcode习题:Pow(x, n)
public class Solution { public double pow(double x, int n) { if(x == 0 || x == 1.0 || n == 1){ return x; }else if(n == 0){ return 1; }原创 2014-05-25 22:27:36 · 776 阅读 · 0 评论