I continue doing LeetCode exercises. Worked on another "Medium" difficulty problem today. Seemed straightforward enough. Find the longest length of any substring in a specified string that does not have any duplicated characters.
This is my practice for C++. Therefore I am using the STL to get more experience with it. Store all substrings in a vector. Write a function to determine if a string has any dup chars using a map. This works for most of the one thousand test cases. But there are a few where LeetCode says my solution took too long.
LOL wut? Some test cases pass in a massive amount of text. I am enumerating all combinations of substrings in there. After I tighten up my code, I guess that my dup detector is just taking too long. Therefore I get rid of the STL map from it. Code is up with straight C arrays. Works fine.
Free Laundry
-
Apparently a lot of apartment buildings have coin operated laundry machines
in the basement. And guess what? You can order a key to unlock the payment
me...