题目 最长无重复字符的子串给定一个字符串,请找出其中无重复字符的最长子字符串. 例如,在"abcabcbb"中,其无重复字符的最长子字符串是"abc",其长度为 3. 对于,"bbbbb",其无重复字符的最长子字符串为"b",长度为1. 解题 利用HashMap,map中不存在就一直加入,存在的时候,找到相同字符的位置,情况map,更改下标 public class Solution { /** * @param s: a s
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input: "bbbbb" Output: 1 Explana
最长无重复字符的子串 Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: Input: "bbbbb" Output
shell sed 替换功能 f1 = open('yesterday','r',encoding='utf-8') f2 = open('yesterday2','w',encoding='utf-8') for line in f1: if '噢 昨日当我年少轻狂'in line: line = line.replace('噢 昨日当我年少轻狂','啦啦啦啦啦啦啦啦啦') f2.write(line) f1.close() f2.close() 要替换的文件: Somehow, it see