注:此分类仅供大概参考,没有精雕细琢。有不同意见欢迎评论~利用堆栈:http://oj.leetcode.com/problems/evaluate-reverse-polish-notation/http://oj.leetcode.com/problems/longest-valid-paren...
分类:
其他好文 时间:
2015-06-08 08:23:23
阅读次数:
119
Well, there many ways to solve this problem. Let's first look at a naive solution.The basic idea is simple. Starting from the first character of the s...
分类:
其他好文 时间:
2015-06-07 21:31:03
阅读次数:
128
The prime 41, can be written as the sum of six consecutive primes:
41 = 2 + 3 + 5 + 7 + 11 + 13
This is the longest sum of consecutive primes that adds to a prime below one-hundred.
The longest s...
分类:
其他好文 时间:
2015-06-07 17:35:13
阅读次数:
129
The first two consecutive numbers to have two distinct prime factors are:
14 = 2 × 7
15 = 3 × 5
The first three consecutive numbers to have three distinct prime factors are:
644 = 2² × 7 × 23
...
分类:
其他好文 时间:
2015-06-07 11:08:41
阅读次数:
106
题目:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which
the length is...
分类:
其他好文 时间:
2015-06-06 14:57:54
阅读次数:
120
Write a function to find the longest common prefix string amongst an array of strings.求最长公共前缀:以第一个字符串为模板比较之后的字符串即可。 1 public class Solution { 2 pu...
分类:
其他好文 时间:
2015-06-06 10:33:58
阅读次数:
102
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-06-06 10:25:13
阅读次数:
115
1 题目:Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longe...
分类:
其他好文 时间:
2015-06-05 15:31:51
阅读次数:
137
Description
We say that integer x, 0 < x < p, is a primitive root modulo odd prime p if and only if the set { (xi mod p) | 1 <= i <= p-1 } is equal to { 1, …, p-1 }. For example, the consecutive power...
分类:
其他好文 时间:
2015-06-04 22:54:39
阅读次数:
231
https://leetcode.com/problems/longest-common-prefix/原题:Write a function to find the longest common prefix string amongst an array of strings.思路:简单,直接遍...
分类:
其他好文 时间:
2015-06-03 19:02:16
阅读次数:
120