LeetCode算法笔记–Day31
3. Longest Substring Without Repeating Characters
题目:
Given a string, find the length of the longest substring without repeating characters.
example
input: “abcabcbb”
output: 3 (“abc”)
example
input: “pwwkew”
output: 3 (“wke”)
My Answer:
1.Hash Map
Time complexity : O(n)
Space complexity : O(n)
1 | /** |