For reference: https://leetcode.com/problems/longest-substring-without-repeating-characters/
So I actually managed to solve this without implementing a full fledged hash table and all testcases succeed except for the last one.
The algorithm that I chose to go with is the one that is hinted: "Generate all possible substrings & check for each substring if it's valid and keep updating maxLen accordingly."
Now the last testcase is a very long one with a lot of duplicate lines on which my solution times out. Is there any way to optimize my solution so that I don't have to use some sort of ugly hardcoded solution for this special test case or use another algorithm altogether?
Thanks in advance