
leetcode
文章平均质量分 74
mine_song
这个作者很懒,什么都没留下…
展开
-
leetcode解题之14# Longest Common Prefix Java版 两种方法实现
14. Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.leetcode解题之14# Longest Common Prefix Java版 两种方法实现原创 2017-03-08 16:10:33 · 810 阅读 · 0 评论 -
leetcode解题之20 # Valid Parentheses Java版
leetcode解题之20 # Valid Parentheses Java版 20. Valid ParenthesesGiven a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all原创 2017-03-08 17:02:03 · 552 阅读 · 0 评论 -
leetcode解题之27 # Remove Element Java版
27 Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave beyond the new length.题目要求从数组中删除指定值的元素,并返回新数组的长度。leetcode解题之27原创 2017-03-08 20:28:25 · 275 阅读 · 0 评论 -
leetcode解题之28 # Implement strStr() Java版
28 Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.解:注意发生不匹配时重写匹配的起始位置leetcode解题之28 # Implement strStr() Java版原创 2017-03-08 21:26:23 · 444 阅读 · 0 评论 -
leetcode解题之206 # Reverse Linked List Java版 (使用头插法反转链表)
leetcode解题之206 # Reverse Linked List Java版 (使用头插法反转链表)原创 2017-03-18 21:45:57 · 1074 阅读 · 1 评论 -
leetcode解题之219 # Contains Duplicate II Java版 (数组中出现重复元素)
leetcode解题之219 # Contains Duplicate II Java版 (数组中出现重复元素原创 2017-03-18 22:12:04 · 853 阅读 · 0 评论 -
leetcode解题之225 # Implement Stack using Queuest Java版 (用两个队列实现一个栈)
leetcode解题之225 # Implement Stack using Queuest Java版 (用两个队列实现一个栈)原创 2017-03-18 22:45:12 · 1038 阅读 · 0 评论 -
leetcode解题之226# Invert Binary Tree Java版 (交换树的左右子树)
leetcode解题之226# Invert Binary Tree Java版 (交换树的左右子树) 226. Invert Binary Tree原创 2017-03-19 07:10:55 · 488 阅读 · 0 评论 -
leetcode解题之258# Add Digits Java版 (相加各个位数)
leetcode解题之258# Add Digits Java版 (相加各个位数)原创 2017-03-19 12:44:03 · 534 阅读 · 0 评论 -
leetcode解题之237# Delete Node in a Linked List Java版 (删除链表中指定的结点)
leetcode解题之237# Delete Node in a Linked List Java版 (删除链表中指定的结点)原创 2017-03-19 12:58:38 · 418 阅读 · 0 评论 -
leetcode解题之242# Valid Anagram Java版 (判断两个字母串是否具有相同的字母组合)
leetcode解题之242# Valid Anagram Java版 (判断两个字母串是否具有相同的字母组合)原创 2017-03-19 13:11:03 · 2252 阅读 · 0 评论 -
leetcode解题之268# Missing NumberJava版 (找出0~N中缺少的数字)
leetcode解题之268# Missing NumberJava版 (找出0~N中缺少的数字)原创 2017-03-19 13:46:22 · 1568 阅读 · 0 评论 -
leetcode解题之303# Range Sum Query - Immutable Java版 (多次计算数组内任意两个下标之间的和)
leetcode解题之303# Range Sum Query - Immutable Java版 (多次计算数组内任意两个下标之间的和)原创 2017-03-19 18:30:10 · 790 阅读 · 0 评论 -
leetcode解题之01#Two Sum Java版
1. Two Sum Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may no原创 2017-03-06 20:15:01 · 240 阅读 · 0 评论 -
leetcode解题之35#Search Insert Position Java版 递归和非递归实现
leetcode解题之35#Search Insert Position Java版 递归和非递归实现原创 2017-03-09 17:53:46 · 311 阅读 · 0 评论 -
leetcode解题之476 # Number Complement Java版
leetcode解题之476 # Number Complement Java版原创 2017-03-10 16:23:09 · 483 阅读 · 0 评论 -
leetcode解题之09#Palindrome Number Java版 两种方法实现
leetcode解题之09#Palindrome Number Java版 两种方法实现,Determine whether an integer is a palindrome. Do this without extra space.原创 2017-03-07 23:03:07 · 388 阅读 · 0 评论 -
leetcode解题之07#Reverse Integer Java版 通过溢出测试
leetcode解题之07#Reverse Integer Java版 通过溢出测试,Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321Note:The input is assumed to be a 32-bit signed integer. Your function should return 0 when the reversed integer overf原创 2017-03-07 22:35:26 · 412 阅读 · 0 评论 -
leetcode解题之21# Merge Two Sorted Lists Java版 递归和非递归实现
leetcode解题之21# Merge Two Sorted Lists Java版 递归和非递归实现 21. Merge Two Sorted ListsMerge 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 lists.原创 2017-03-08 19:33:02 · 1037 阅读 · 0 评论 -
leetcode解题之23.Merge k Sorted Lists Java版本(合并k个有序的链表)
leetcode解题之23.Merge k Sorted Lists Java版本(合并k个有序的链表)原创 2017-04-07 10:32:55 · 2769 阅读 · 0 评论 -
leetcode解题之31. Next Permutation java 版(下一个排列)
leetcode解题之31. Next Permutation java 版(下一个排列)原创 2017-04-07 12:53:09 · 1493 阅读 · 0 评论 -
leetcode解题之34. Search for a Range java 版(数字在排序数组中出现的次数)
leetcode解题之34. Search for a Range java 版(数字在排序数组中出现的次数)原创 2017-04-07 14:37:59 · 1036 阅读 · 0 评论 -
leetcode解题之 Search a 2D Matrix java 版(在二维矩阵中查找)
leetcode解题之 74.Search a 2D Matrix java 版(在二维矩阵中查找) ,二分查找,240. Search a 2D Matrix II原创 2017-04-07 15:12:28 · 893 阅读 · 0 评论 -
leetcode解题之58 # Length of Last Word Java版
leetcode解题之58 # Length of Last Word Java版原创 2017-03-12 22:22:34 · 404 阅读 · 0 评论 -
leetcode解题之66 # Plus One Java版
leetcode解题之66 # Plus One Java版原创 2017-03-13 09:30:20 · 889 阅读 · 0 评论 -
leetcode解题之414 # Third Maximum Number Java版
leetcode解题之414 # Third Maximum Number Java版原创 2017-03-12 21:09:10 · 1027 阅读 · 0 评论 -
leetcode解题之67 # Add Binary Java版
leetcode解题之67 # Add Binary Java版原创 2017-03-13 10:40:25 · 1052 阅读 · 0 评论 -
leetcode解题之70 #Climbing Stairs Java版 (青蛙跳台阶)
leetcode解题之70 #Climbing Stairs Java版 (青蛙跳台阶)原创 2017-03-13 12:00:26 · 506 阅读 · 0 评论 -
leetcode解题之83 # Remove Duplicates from Sorted List Java版
leetcode解题之83 # Remove Duplicates from Sorted List Java版,删除链表重复元素原创 2017-03-13 17:25:41 · 318 阅读 · 0 评论 -
leetcode解题之88 #Merge Sorted Array Java版
leetcode解题之88 #Merge Sorted Array Java版原创 2017-03-13 18:57:34 · 1208 阅读 · 0 评论 -
leetcode解题之416#Partition Equal Subset SumJava版. 对半分(0-1背包,动态规划)
leetcode解题之416#Partition Equal Subset SumJava版. 对半分(0-1背包,动态规划)原创 2017-03-23 09:20:11 · 592 阅读 · 0 评论 -
leetcode解题之100# Same Tree Java版
leetcode解题之100# Same Tree Java版,给定两个二叉树,判断这两棵树是否相等。原创 2017-03-13 19:07:47 · 428 阅读 · 0 评论 -
leetcode解题之101# Symmetric Tree Java版(对称树)
leetcode解题之101# Symmetric Tree Java版(对称树)原创 2017-03-13 19:20:58 · 436 阅读 · 0 评论 -
leetcode解题之53 # Maximum Subarray Java版
leetcode解题之53 # Maximum Subarray Java版原创 2017-03-12 21:45:30 · 1682 阅读 · 0 评论 -
leetcode解题之122# Best Time to Buy and Sell Stock II
leetcode解题之122# Best Time to Buy and Sell Stock II原创 2017-03-13 21:54:50 · 276 阅读 · 0 评论 -
leetcode解题之 Combination Sum java 版(组合求和)
leetcode解题之 Combination Sum java 版(查找数字和DFS) ,深度优先遍历,回溯,39. Combination Sum ,40. Combination Sum II原创 2017-04-08 18:31:53 · 1783 阅读 · 0 评论 -
leetcode解题之 508. Most Frequent Subtree Sum II java 版(求子树和)
508. Most Frequent Subtree Sum , leetcode解题之 508. Most Frequent Subtree Sum II java 版(求子树和) 给一棵树,找出现次数最多的子树和。子树和就是一个结点以及它下方所有结点构成的子树的总和,在这些总和中找一个出现次数最多的结果,如果有很多个这样的结果,返回这些结果构成的数组。原创 2017-04-08 19:50:21 · 289 阅读 · 0 评论 -
leetcode解题之215. Kth Largest Element in an Array java 版(第k大的数字)
leetcode解题之215. Kth Largest Element in an Array java 版(第k大的数字)原创 2017-04-08 21:18:13 · 1182 阅读 · 0 评论 -
leetcode解题之347. Top K Frequent Elements &451. Sort Characters By Frequency
leetcode解题之347. Top K Frequent Elements &451. Sort Characters By Frequency,统计词频,最小堆,最大堆,hashmap原创 2017-04-08 21:59:19 · 387 阅读 · 0 评论 -
leetcode解题之107 # Binary Tree Level Order Traversal II Java版
leetcode解题之107 # Binary Tree Level Order Traversal II Java版原创 2017-03-13 20:08:42 · 514 阅读 · 0 评论