Mark As Completed Discussion

Good evening! Here's our prompt for today.

Given a string of characters, can you find the longest substring of the string that has no repeating characters?

An example is shown below:

Description
JAVASCRIPT
1lengthOfLongestSubstring("abracadabar");
2// 4 because it is 'brac'

Constraints

  • Length of the string <= 100000
  • The string will only contain lowercase letters
  • Expected time complexity : O(n)
  • Expected space complexity : O(1)

In this challenge, we'll discuss a simple but efficient method for finding the longest substring with no repeating characters.

Try to solve this here or in Interactive Mode.

How do I practice this challenge?

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment

Here's our guided, illustrated walk-through.

How do I use this guide?