Longest Unique Substring Problem Statement

Given a string input of length 'n', your task is to determine the length of the longest substring that contains no repeating characters.

Explanation:

A substring is a continuous sequence of characters within a string, formed by removing zero or more characters from the ends while maintaining the order.

Input:

A single line consisting of a string of length 'n' containing lowercase alphabets.

Output:

An integer representing the length of the longest substring with unique characters.

Example:

Input:
s = "abcabcbb"
Output:
3
Explanation:

The answer is "abc", with the length of 3.

Constraints:

  • 1 <= n <= 10^5
  • Time Limit: 1 sec
Be the first one to answer
Add answer anonymously...
Freshworks Lead Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter