N distinct

Given a string and number n, find the longest substring with n distinct chars.