AlgoUniversity
  • Go Back
Discussion
Substring Without Repeating Characters :

Author

Ujjwal Srivastava

Difficulty Level : Medium

Submissions : 235

Asked In : Tekion

Marks :30

: 3 | : 0

Given a string $$$s$$$, find the length of the longest substring without repeating characters.

Input

The first line contains an integer $$$n$$$ denoting the length of the string. The second line contains a string $$$s$$$ consisting of English letters, digits, and symbols.$$$(1\le n \le 5 \cdot 10^4).$$$

Output

Output the longest substring without repeating characters

Examples

Input
9
abcgracse
Output
6
Input
4
okuo
Output
3
Input
8
abcAacbB
Output
5
Input
5
bbbbb
Output
1
Input
6
$dgr$4
Output
5

You need to login to view your submissions.

You need to login to view all submissions.

Loading...

Result : Executed

Loading...

Feel something is wrong with the test cases?

Result : Accepted

Test Cases :

You need to Log In
We're glad that you want to attempt this problem!

But to Run or Submit the Problem, you need to Log In.

Continue to Log In
Challenge Submitted!

Your challenge has been submitted successfully.

You will get a response soon via WhatsApp or Email.

Challenge
Facing issue while trying to solve the problem! Don't worry, we got you covered!

Do let us know your issue.

Looks good!
Please enter your issue / feedback.

How do we get in touch with you?
Looks good!
Please enter your phone no.
Looks good!
Please enter your email address.