leetcode.jp 博客
本网站所有文字及图片内容均来自网络,每周定时更新,仅供个人学习与研究,请勿用于商业用途。谢谢合作。

3. Longest Substring Without Repeating Characters

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
Explanation: The answer is "b", with the length of 1.

Example 3:

Input: "pwwkew"
Output: 3
Explanation: The answer is "wke", with the length of 3. 
             Note that the answer must be a substring, "pwke" is a subsequence and not a substring.

Difficulty:

Medium

Lock:

Normal

Company:

Adobe Alation Alibaba Amazon Apple Atlassian Baidu Bloomberg ByteDance Cisco eBay Expedia Facebook Goldman Sachs Google Huawei Microsoft Oracle Paypal Salesforce Samsung SAP Snapchat Tencent Twitch Uber VMware Walmart Labs Yahoo Yandex Yelp Zillow Zoho

Solution(Chinese):

LEETCODE 3. Longest Substring Without Repeating Characters