-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq_10123_Longest_Substring_Without_Repeating_Characters.json
46 lines (46 loc) · 1.38 KB
/
q_10123_Longest_Substring_Without_Repeating_Characters.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"question": {
"qid": "q_10123",
"diff": 2,
"tags": ["Hash Table", "Two Pointers", "Sliding Window"],
"title": "Longest Substring Without Repeating Characters",
"prompt": [
"Given a string {{ s }}, find the length of the longest substring without repeating characters."
],
"examples": [
{
"input": "\"abcabcbb\"",
"output": "3",
"explanations": ["The answer is \"abc\", with the length of 3."]
},
{
"input": "\"bbbbb\"",
"output": "1",
"explanations": ["The answer is \"b\", with the length of 1."]
},
{
"input": "\"pwwkew\"",
"output": "3",
"explanations": [
"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."
]
}
],
"constraints": [
"0 <= s.length <= 5 * 10^4",
"s consists of English letters, digits, symbols and spaces."
],
"functionArguments": ["s"],
"hints": [
"Use a sliding window approach to keep track of the longest substring without repeating characters."
]
},
"testcases": [
{ "tid": "1", "input": ["abcabcbb"], "expected": 3 },
{ "tid": "2", "input": ["bbbbb"], "expected": 1 },
{ "tid": "3", "input": ["pwwkew"], "expected": 3 }
],
"submitted": 0,
"accepted": 0,
"questionLevel": 3
}