Visa Inc. Interview Question

I was asked to solve the longest subsequence with k unique characters problem.