Can T have characters repeating ?

  • 46

    Can the String T have repeating characters - for instance "AA"? In that case should the minimum window contain two A's or does it suffice for it have a single A.

  • 21

    Yes, T could have repeating chars. And minimum window should contain all of them. Here is an example test case from OJ:

    Input: "aa", "aa"

    Expected: "aa"

  • 3

    Yeah this problem really really needs to specify that. Really annoying to have to guess on that kind of thing because looking at discuss will often spoil what type of approach you should be taking.

Log in to reply

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