Shortest substring with N distinct characters
Given a string and a number n, return the shortest substring that contains n distinct letters (or say that none exists). Use a sliding window that grows until it holds n distinct letters and then shrinks from the left. The round gave about twenty minutes for it.
No answer yet. Write the first one; the best answer gets endorsed.
