LeetCode 3 Longest Substring Without Repeating Characters - Problem Statement

The problem

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

With s = "abcabcbb", the answer is 3. The substring "abc" has all unique characters. Other substrings like "bca" also work, but none longer than 3 have all unique characters.

What data structure helps you quickly check if a character is already in your current substring?

Constraints: 0n5×1040 \le n \le 5 \times 10^4.