``` class Solution: def lengthOfLongestSubstring(self, s: str) -> int: # outlier if s == "": return 0 if len(s) == 1: return 1 max_i = 0 start = 0 end... ...
分类:
其他好文 时间:
2020-03-06 20:22:22
阅读次数:
56
ERROR: Could not find a valid gem ‘redis‘ (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (https://rubygems.org/latest_specs.4.8.gz)
Error fetching http://ruby.taobao.org/:
server did not return a valid file (http://ruby.taobao.org/specs.4.8.gz)
Error fetching https://rubygems.org:
SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (https://rubygems.org/specs
分类:
其他好文 时间:
2020-03-06 19:44:22
阅读次数:
72
1. Description: Notes: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 */ 4 class Solution { 5 public int minAddToMakeValid(S ...
分类:
编程语言 时间:
2020-03-02 15:08:12
阅读次数:
76
1. Description: 2. Examples: 3.Solutions: 1 /** 2 * Created by sheepcore on 2019-05-07 3 */ 4 5 class Solution { 6 public boolean isValid(String s) { ...
分类:
编程语言 时间:
2020-03-02 14:28:01
阅读次数:
68
Given a m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i] ...
分类:
其他好文 时间:
2020-03-02 10:51:12
阅读次数:
71
1 """ 2 Evaluate the value of an arithmetic expression in Reverse Polish Notation. 3 Valid operators are +, -, *, /. Each operand may be an integer or ...
分类:
其他好文 时间:
2020-03-01 09:15:40
阅读次数:
51
最多有K个不同字符的最长子串。题意就不解释了,参见159题。例子, Example 1: Input: s = "eceba", k = 2 Output: 3 Explanation: T is "ece" which its length is 3. Example 2: Input: s = ...
分类:
其他好文 时间:
2020-02-28 15:37:15
阅读次数:
51
最多有两个不同字符的最长子串。题意是给一个字符串,请返回一个最长子串的长度。子串的要求是最多只有两个不同的字母。例子, Example 1: Input: "eceba" Output: 3 Explanation: tis "ece" which its length is 3. Example ...
分类:
其他好文 时间:
2020-02-28 13:52:03
阅读次数:
68
1 """ 2 Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). 3 Example: 4 Inpu ...
Given a string s consisting only of characters a, b and c. Return the number of substrings containing at least one occurrence of all these characters ...
分类:
其他好文 时间:
2020-02-25 13:10:02
阅读次数:
53