How would you get the biggest (longest) substring from a string?
Asked in the Technical face-to-face stage, early in the technical round alongside project questions. The exact substring criterion was not stated, so use the standard interpretation: return the longest substring containing no repeated characters. If multiple results have the same length, return the one appearing first.
Implement def longest_substring(s):. The input is a string, and the output is the selected substring.
def longest_substring(s):