LeetCode Solutions in C++23, Java, Python, MySQL, and TypeScript. Longest Substring Without Repeating Characters - Given a string s, find the length of the longest substring without duplicate characters . Example 1: Input: s = "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Note that "bca" and "cab" are also correct answers. Given a string s, find the length of the longest substring without repeating characters . Examples: Input: s = "geeksforgeeks" Output: 7 Explanation: Longest substring is "eksforg". Learn how to find the longest substring without repeating a character in Java.