牛刀小试之leetcode

1 已关注
19篇博文
• 29. Divide Two Integers（Java）

29. Divide Two Integers（Java） Divide two integers without using multiplication, division and mod ope...

2016-12-06 21:14
313
• 28. Implement strStr() java

28 Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if ne...

2016-11-27 22:26
571
• 27. Remove Element(Java)

27. Remove Element(Java) Given an array and a value, remove all instances of that value in place and...

2016-11-27 21:59
294
• 26. Remove Duplicates from Sorted Array（java）

26. Remove Duplicates from Sorted Array（java）

2016-11-21 10:17
270
• 25. Reverse Nodes in k-Group（java）

25. Reverse Nodes in k-Group（java）Given a linked list, reverse the nodes of a linked list k at a tim...

2016-11-17 10:31
292
• 23. Merge k Sorted Lists(java实现)

23. Merge k Sorted Lists(java实现)

2016-11-07 11:10
441
• 24. Swap Nodes in Pairs （java实现）

24. Swap Nodes in Pairs （java实现）

2016-11-14 09:49
353
• 21. Merge Two Sorted Lists

21. Merge Two Sorted Lists Merge two sorted linked lists and return it as a new list. The new list s...

2016-10-21 14:03
157
• Valid Parentheses(java实现)

Valid Parentheses(java实现)Given a string containing just the characters '(', ')', '{', '}', '[' and '...

2016-10-20 21:17
234
• Remove Nth Node From End of List(java实现)

Remove Nth Node From End of List(java实现)Given a linked list, remove the nth node from the end of lis...

2016-10-19 09:39
374
• 4Sum

4 Sum Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d...

2016-10-14 10:11
216
• Letter Combinations of a Phone Number

Letter Combinations of a Phone Number

2016-10-10 19:56
308
• leetcode Reverse digits of an integer（经测试绝对正确）

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click...

2016-09-09 09:55
2350
• String to Integer (atoi)

Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases...

2016-09-12 20:36
201
• Palindrome Number leetcode

Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. ...

2016-09-20 10:29
123
• Container With Most Water (Java实现)

当看见这道题时想到的一个答案就是暴力破解，附上代码package com.alibaba; import java.util.Scanner; public class Solution { p...

2016-09-23 09:42
211
• Longest Common Prefix

public class Solution { public String longestCommonPrefix(String[] strs) { if (strs.length ==...

2016-09-27 09:53
152
• 3Sum java leetcode

3Sum Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find ...

2016-09-30 09:56
162
• 3Sum Closest(java实现)

3Sum Closest(java实现) Given an arrayS of n integers, find three integers in S such that the sum is cl...

2016-10-03 16:17
380