Write a function that takes in a string and that returns its longest substring without duplicate characters. Assume that there will only be one longest substring without duplication.
Sample input:"clementisacap" Sample output:"mentisac"
We can use a Stack here
Check this Python code.