Given n keys and a string. Find the maximum substring which uses less numbers of keys.

  • 0

    Given "n" Keys (let's say we have 26 keys) and a String. Find the maximum length substring which uses minimum number of keys.

    eg: abcdabbcdbbbb : Here bbcdbbbb is using only 3 characters out of n keys and llength is 8.

  • 1

    For the string "abcaaa ": the answer is "aaa" or "caaa". The decision making is very hard here.

  • 0

    The explanation of the question is not very clear. I think the question asks us to find the longest substring using no more than "n" keys. So, n is an input.

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.