Parentheses Accepted : 8 Submit : 19 Time Limit : 3000 MS Memory Limit : 65536 KB Parentheses Bobo has a very long sequence divided into n consecutive... ...
分类:
其他好文 时间:
2017-05-16 15:03:26
阅读次数:
257
Problem statement: Given two strings, find the longest common subsequence (LCS). Your code should return the length of LCS. Have you met this question ...
分类:
其他好文 时间:
2017-05-15 23:52:55
阅读次数:
381
Problem statement: Given an unsorted array of integers, find the length of longest increasing subsequence. For example,Given [10, 9, 2, 5, 3, 7, 101, ...
分类:
其他好文 时间:
2017-05-15 23:45:49
阅读次数:
159
1 public String longestPalindrome(String s) { 2 char[] ch = s.toCharArray(); 3 int longestLength = 0; 4 int[] longestIndex = {0, 0}; 5 for(int i = 0; ... ...
分类:
其他好文 时间:
2017-05-15 14:14:57
阅读次数:
150
1 public int lengthOfLongestSubstring(String s) { 2 char[] chars = s.toCharArray(); 3 //存储已遍历的元素中相应char值最后出现的位置 4 HashMap map = new HashMap(); 5 //当遍历... ...
分类:
其他好文 时间:
2017-05-14 13:40:20
阅读次数:
132
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l ...
分类:
其他好文 时间:
2017-05-13 16:08:33
阅读次数:
187
一、servletContext概述 servletContext对象是Servlet三大域对象之一,每个Web应用程序都拥有一个ServletContext对象,该对象是Web应用程序的全局对象或者上下文。Tomcat服务器在启动时,会自动创建一个ServletContext对象,在关闭时,会自动 ...
分类:
其他好文 时间:
2017-05-12 23:55:02
阅读次数:
275
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:
其他好文 时间:
2017-05-12 14:26:28
阅读次数:
102
Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,1,0,1,1,1] Output: 3 Explanation: The first two di ...
分类:
其他好文 时间:
2017-05-12 13:40:13
阅读次数:
214
题: 遍历比较。 一本正经地说一下思路。 最长前缀。 一旦找到一个不匹配,就无法做成最长前缀。 所有我们的目的就是去找这个不匹配。 注意一下字符串为空的情况,每次都会栽在这里。 为了提高效率,找出最短字符串,因为最长前缀的长度不可能超过最短字符串的长度。 哎,心累。没有用例。 ...
分类:
编程语言 时间:
2017-05-11 22:24:47
阅读次数:
126