
Description
Given a string, find the length of the longest substring without repeating characters.
My Solution
Python
1 |
class (object): |
- 想法:使用栈,若有重复元素,则弹出直至无重复元素。
Best Solution
Python
1 |
used = {} |
- 想法:使用哈希表来储存该元素出现的位置

Given a string, find the length of the longest substring without repeating characters.
1 |
class (object): |
1 |
used = {} |
近期评论