无重复字符的最长子串_Helios丶的博客-CSDN博客

网站介绍:文章浏览阅读41次。//时间复杂度O(n),空间复杂度 O(s.length()) public int lengthOfLongestSubstring(String s) { if(s == null || s.length() == 0){ return 0; } HashSet<Character> set = new HashSet<>(); int rk = -1, ans = 0, n = s.