I have the following question and I found this [Permutation of string as substring of another](https://stackoverflow.com/questions/22737407/permutation-of-string-as-substring-of-another), but this is using C++, I am kind of confused applying to python. 

> 
> Given two strings s and t, determine whether some anagram of t is a
>  substring of s. For example: if s = "udacity" and t = "ad", then the
>  function returns True. Your function definition should look like:
>  question1(s, t) and return a boolean True or False.
> 
> 
> 

So I answered this question but they want me to use dictionaries instead of sorting string. The reviewer saying that;

> 
> We can first compile a dictionary of counts for t and check with every
>  possible consecutive substring sets in s. If any set is anagram of t,
>  then we return True, else False. Comparing counts of all characters
>  will can be done in constant time since there are only limited amount
>  of characters to check. Looping through all possible consecutive
>  substrings will take worst case O(len(s)). Therefore, the time
>  complexity of this algorithm is O(len(s)). space complexity is O(1)
>  although we are creating a dictionary because we can have at most 26
>  characters and thus it is bounded.
> 
> 
> 

Could you guys please help how I can use dictionaries in my solution.

Here is my solution;

```
# Check if s1 and s2 are anagram to each other
def anagram_check(s1, s2):
    # sorted returns a new list and compare
    return sorted(s1) == sorted(s2)

# Check if anagram of t is a substring of s
def question1(s, t):
    for i in range(len(s) - len(t) + 1):
        if anagram_check(s[i: i+len(t)], t):
            return True
    return False

def main():
    print question1("udacity", "city")

if __name__ == '__main__':
    main()  

'''
Test Case 1: question1("udacity", "city") -- True
Test Case 2: question1("udacity", "ud") -- True
Test Case 3: question1("udacity", "ljljl") -- False
'''

```

Any help is appreciated. Thank you,