LeetCode
文章平均质量分 68
hechenghai
已经不走技术路线了,可能没法回到大家的问题了,抱歉!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
[LeetCode]First Missing Positive
First Missing Positive My Submissions Question Total Accepted: 51712 Total Submissions: 224707 Difficulty: Hard Given an unsorted integer array, find the first missing positive int原创 2015-11-10 11:41:29 · 509 阅读 · 0 评论 -
LeetCode(5) Longest Palindromic Substring
题目为: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. 使用动态规划,可以将时间原创 2015-05-27 15:15:56 · 419 阅读 · 0 评论 -
ZigZag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I原创 2015-07-02 08:40:27 · 485 阅读 · 0 评论 -
LeetCode – Regular Expression Matching in Java
Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element. The matching should cover the entire inp转载 2015-07-26 00:46:43 · 603 阅读 · 0 评论 -
Reverse Integer
Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Have you thought about this? Here are some good questions to ask before c转载 2015-07-07 23:51:43 · 501 阅读 · 0 评论 -
LeetCode Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space. public class Solution { public boolean isPalindrome(int x) { if(x<0)return false; int a = 1; int b = x;原创 2015-07-16 09:06:33 · 422 阅读 · 0 评论 -
[LeetCode] Search Insert Position
Search Insert Position My Submissions Question Total Accepted: 79962 Total Submissions: 222866 Difficulty: Medium Given a sorted array and a target value, return the index if the t原创 2015-11-05 23:05:19 · 409 阅读 · 0 评论 -
[LeetCode]4Sum
4Sum My Submissions Question Solution Total Accepted: 50999 Total Submissions: 230927 Difficulty: Medium Given an array S of n integers, are there elements a, b, c, and d in S s转载 2015-10-20 19:20:57 · 518 阅读 · 0 评论 -
[LeetCode] Roman to Integer
Roman to Integer My Submissions Question Solution Total Accepted: 56002 Total Submissions: 159037 Difficulty: Easy Given a roman numeral, convert it to an integer. Input is gua原创 2015-10-10 10:41:16 · 386 阅读 · 0 评论 -
LeetCode Container With Most Water
Container With Most Water Total Accepted: 52276 Total Submissions: 163550 Difficulty: Medium Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinat原创 2015-09-20 22:58:21 · 399 阅读 · 0 评论 -
[LeetCode] Integer to Roman
Integer to Roman My Submissions Question Solution Total Accepted: 44525 Total Submissions: 127649 Difficulty: Medium Given an integer, convert it to a roman numeral. Input is g原创 2015-10-10 10:16:09 · 442 阅读 · 0 评论 -
[LeetCode] Longest Common Prefix
Longest Common Prefix My Submissions Question Solution Total Accepted: 68487 Total Submissions: 264798 Difficulty: Easy Write a function to find the longest common prefix string原创 2015-10-10 13:57:58 · 403 阅读 · 0 评论 -
LeetCode Median of Two Sorted Arrays
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). 这个题目实际上就是先用快速排序进行合并,然后求中间原创 2015-05-13 00:10:44 · 569 阅读 · 0 评论 -
[LeetCode]Substring with Concatenation of All Words
Substring with Concatenation of All Words My Submissions Question Total Accepted: 42899 Total Submissions: 215720 Difficulty: Hard You are given a string, s, and a list of words, w原创 2015-10-28 15:47:54 · 438 阅读 · 0 评论 -
[LeetCode]Wildcard Matching
转载地址:http://www.cnblogs.com/felixfang/p/3708999.html 开篇 通常的匹配分为两类,一种是正则表达式匹配,pattern包含一些关键字,比如'*'的用法是紧跟在pattern的某个字符后,表示这个字符可以出现任意多次(包括0次)。 另一种是通配符匹配,我们在操作系统里搜索文件的时候,用的就是这种匹配。比如 "*.pdf",'转载 2015-11-14 16:26:15 · 622 阅读 · 0 评论 -
LeetCode问题 pow(x,n)
转载地址:http://blog.csdn.net/fengbingyang/article/details/12236121 实现浮点类型的幂运算,函数原型为: double pow(double x, int n) 下面介绍一下解决该问题的几种方法以及要注意的地方: 1)最直观容易想到的方法就是用递归方法求n个x的乘积,注意考虑n的正负号,时间复杂度为O(n)转载 2015-11-21 14:39:04 · 445 阅读 · 0 评论 -
[LeetCode]Decode Ways
Decode Ways My Submissions Question Total Accepted: 55371 Total Submissions: 330911 Difficulty: Medium A message containing letters from A-Z is being encoded to numbers using the原创 2015-12-08 20:20:34 · 601 阅读 · 0 评论 -
Jump Game II
Jump Game II My Submissions Question Total Accepted: 52353 Total Submissions: 213392 Difficulty: Hard Given an array of non-negative integers, you are initially positioned at the f转载 2015-11-17 10:15:27 · 479 阅读 · 0 评论 -
[LeetCode]Search in Rotated Sorted Array
Search in Rotated Sorted Array My Submissions Question Total Accepted: 76870 Total Submissions: 264831 Difficulty: Hard Suppose a sorted array is rotated at some pivot unknown to y原创 2015-11-02 10:22:35 · 419 阅读 · 0 评论 -
[LeetCode]Search for a Range
Search for a Range My Submissions Question Total Accepted: 62397 Total Submissions: 225032 Difficulty: Medium Given a sorted array of integers, find the starting and ending positio原创 2015-11-02 11:21:54 · 454 阅读 · 0 评论 -
Unique Paths
A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the转载 2015-11-26 23:39:07 · 452 阅读 · 0 评论 -
使用mahout下的朴素贝叶斯分类器对新闻分类
转载地址:http://www.letiantian.me/2014-10-22-mahout-naive-bayes-newsgroups/ mahout版本是0.9;hadoop版本是1.2.1。 下载数据集20 newsgroups dataset,解压后得到20news-bydate目录: $ cp -R 20news-bydate/*/* 2转载 2015-12-18 14:48:37 · 3939 阅读 · 1 评论 -
[LeetCode]Search in Rotated Sorted Array II
Search in Rotated Sorted Array II My Submissions Question Total Accepted: 50992 Total Submissions: 162671 Difficulty: Medium Follow up for "Search in Rotated Sorted Array": What i原创 2015-12-02 19:22:20 · 440 阅读 · 0 评论 -
[LeetCode]Largest Rectangle in Histogram
Largest Rectangle in Histogram My Submissions Question Total Accepted: 49964 Total Submissions: 215334 Difficulty: Hard Given n non-negative integers representing the histogram原创 2015-12-06 11:27:35 · 581 阅读 · 0 评论 -
LeetCode Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors. OJ's undirected graph serialization: Nodes are labeled uniquely. We use # as a separator for each原创 2014-11-27 16:03:01 · 477 阅读 · 0 评论 -
Leet Reorder List
https://oj.leetcode.com/problems/reorder-list/原创 2014-10-05 23:16:18 · 604 阅读 · 0 评论 -
LeetCode Binary Tree Postorder Traversal
点https://oj.leetcode.com/problems/binary-tree-postorder-traversal/接原创 2014-09-29 10:22:54 · 486 阅读 · 0 评论 -
LeetCode Linked List Cycle II
https://oj.leetcode.com/problems/linked-list-cycle-ii/接原创 2014-10-08 22:39:42 · 528 阅读 · 0 评论 -
LeetCode Word Break
https://oj.leetcode.com/problems/word-break/原创 2014-10-10 15:22:53 · 461 阅读 · 0 评论 -
Binary Tree Preorder Traversal
https://oj.leetcode.com/problems/binary-tree-preorder-traversal/原创 2014-10-01 11:22:05 · 484 阅读 · 0 评论 -
LeetCode Linked List Cycle
https://oj.leetcode.com/problems/linked-list-cycle/原创 2014-10-09 20:02:05 · 519 阅读 · 0 评论 -
LeetCode Word Break II
https://oj.leetcode.com/problems/word-break-ii/ zh原创 2014-10-09 23:50:44 · 547 阅读 · 0 评论 -
LeetCode: Copy List with Random Pointer
https://oj.leetcode.com/problems/copy-list-with-random-pointer/原创 2014-10-10 22:20:01 · 446 阅读 · 0 评论 -
LeetCode Single Number II
public class Solution { public int singleNumber(int [] A){ Arrays.sort(A); int n = A.length; for(int i=0;i<n-1;i+=3){ if(!(A[i]==A[i+1]&&A[i+1]==A[i+2])){ if(A[i]==A[i+1]){ return A原创 2014-10-18 19:31:52 · 544 阅读 · 0 评论 -
LeetCode Single Number
public class Solution { public int singleNumber(int [] A){ Arrays.sort(A); int n = A.length; for(int i=0;i<n-1;i+=2){ if(A[i]!=A[i+1]){ return A[i]; } } return A[n-1]; } }原创 2014-10-18 19:40:03 · 498 阅读 · 0 评论 -
LeetCode Candy
https://oj.leetcode.com/problems/candy/原创 2014-10-18 21:49:08 · 558 阅读 · 0 评论 -
leetCode LRU Cache
点击打开链接原创 2014-09-27 13:11:42 · 640 阅读 · 0 评论 -
LeetCode Palindrome Partitioning II
Given a string s, partition s such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = "aab", Retu原创 2014-11-29 21:41:03 · 432 阅读 · 0 评论 -
LeetCode Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to原创 2014-11-06 17:02:08 · 542 阅读 · 0 评论 -
LeetCode Palindrome Partitioning
https://oj.leetcode.com/problems/palindrome-partitioning/ Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome parti原创 2014-12-06 14:13:18 · 452 阅读 · 0 评论
分享