Checking every substring is substrings, and verifying each for uniqueness takes . Total: . Way too slow.
Think about what happens when you find a duplicate. You don't need to start over from scratch. If "abcb" has a duplicate at the end, you know the next valid substring starts after the first "b".