一、前言 二、题485 Max Consecutive Ones Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Note: The input array will ...
分类:
编程语言 时间:
2017-11-14 17:17:20
阅读次数:
183
题目:Write a function to find the longest common prefix string amongst an array of strings. 这题的意思是,求字符串数组中的所有字符串的公共头。 解题思路:由于要求所有字符串的公共头,和求几个整数的公约数一样。我们 ...
分类:
其他好文 时间:
2017-11-13 19:53:57
阅读次数:
145
题目链接:https://leetcode.com/problems/longest-substring-without-repeating-characters/description/ 题目大意:找出一串字符串的无重复子串。例子如下: 法一:两层for循环,一个字符一个字符的遍历其后是否有子串, ...
分类:
其他好文 时间:
2017-11-13 11:29:01
阅读次数:
137
Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo ...
分类:
其他好文 时间:
2017-11-11 11:28:04
阅读次数:
107
Nov, 9, 2017. https://leetcode.com/problemset/algorithms/?topicSlugs=union-find%2Clinked-list Given an unsorted array of integers, find the length of ...
分类:
其他好文 时间:
2017-11-10 00:30:55
阅读次数:
128
Given a list of strings words representing an English Dictionary, find the longest word in words that can be built one character at a time by other wo ...
分类:
其他好文 时间:
2017-11-06 19:13:26
阅读次数:
142
Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This ...
分类:
其他好文 时间:
2017-11-05 11:27:28
阅读次数:
134
Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: "babad" Output: "b ...
分类:
其他好文 时间:
2017-11-04 14:54:23
阅读次数:
147
Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the leng ...
分类:
其他好文 时间:
2017-11-04 13:35:47
阅读次数:
146
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo ...
分类:
其他好文 时间:
2017-11-04 13:34:15
阅读次数:
116