Compare commits

...

3 Commits

Author SHA1 Message Date
wangsiyuan e8f2a5b6b1 更新 Solution.java 2023-09-05 15:54:21 +08:00
wangsiyuan 2273c1e6e1 更新 workspace.xml 2023-09-05 15:54:18 +08:00
wangsiyuan b4a5a090c1 更新 Solution.java 2023-09-05 15:53:44 +08:00
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,6 @@
<list default="true" id="45f625e1-36c7-4942-8f7c-ba3ebe9a7d53" name="变更" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/solution/Solution.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/solution/Solution.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/solution/test.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/solution/test.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -78,7 +77,7 @@
<option name="presentableId" value="Default" />
<updated>1693822719192</updated>
<workItem from="1693822720224" duration="5742000" />
<workItem from="1693895305007" duration="5015000" />
<workItem from="1693895305007" duration="5131000" />
</task>
<servers />
</component>

View File

@ -6,6 +6,8 @@ import java.util.Map;
import java.util.Set;
public class Solution {
//给定一个字符串 s ,找出其中不含有重复字符的 最长子串 的长度。
public int lengthOfLongestSubstring(String s) {
// 哈希集合,记录每个字符是否出现过
Set<Character> occ = new HashSet<Character>();