LeetCode — Longest Substring without reapting characters (MSFT)

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

Example 1:

Example 2:

Example 3:

Constraints:

  • 0 <= s.length <= 5 * 104
  • s consists of English letters, digits, symbols and spaces.

Solution:

Time complexity: O(N)

Space complexity: O(N)

LeetCode — Length of longest substring (MSFT Interview Q)

--

--

👨‍💻

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store