Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Example 1: Input: ...
分类:
其他好文 时间:
2019-04-09 12:27:51
阅读次数:
136
``` class Solution { public: bool isNumber(string s) { bool num = false, numAfterE = true, dot = false, exp = false, sign = false; int n = s.size(); f ...
分类:
其他好文 时间:
2019-04-09 11:07:58
阅读次数:
131
1. 原始题目 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 示例 2: 示例 3: 2. 我的解法 每次都寻找不同的字符放到空表里,直到有相同的出现。这时指针指向下一位进行下一轮搜索。 我的时间复杂度比较高,新建立许多变量,导致空间占用较多。Leetcode上另一个 ...
分类:
其他好文 时间:
2019-04-09 10:55:19
阅读次数:
149
[TOC] 题目描述: 给定仅有小写字母组成的字符串数组 ,返回列表中的每个字符串中都显示的全部字符( 包括重复字符 )组成的列表。例如,如果一个字符在每个字符串中出现 3 次,但不是 4 次,则需要在最终答案中包含该字符 3 次。 你可以按任意顺序返回答案。 示例 1: 示例 2: 提示: 1. ...
分类:
其他好文 时间:
2019-04-09 00:33:53
阅读次数:
149
For each prefix of a given string S with N characters (each character has an ASCII code between 97 and 126, inclusive), we want to know whether the pr ...
分类:
其他好文 时间:
2019-04-09 00:31:16
阅读次数:
99
1021. Remove Outermost Parentheses A valid parentheses string is either empty (""), "(" + A + ")", or A + B, where A and B are valid parentheses strin ...
分类:
其他好文 时间:
2019-04-07 22:24:51
阅读次数:
172
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer ...
分类:
其他好文 时间:
2019-04-07 09:32:59
阅读次数:
101
一:str.isalnum() ,str.isalpha(),str.isdigit() ,str.islower() ,str.isupper() 1.str.isalnum() This method checks if all the characters of a string are al ...
分类:
其他好文 时间:
2019-04-06 19:19:48
阅读次数:
183
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.For "(()", the lon ...
分类:
其他好文 时间:
2019-04-05 20:07:23
阅读次数:
186