Map stores the words present in list L against it 's occurrences inside list L
hash_map = dict ( ) NEW_LINE for i in range ( word_count ) : NEW_LINE INDENT if L [ i ] in hash_map : NEW_LINE INDENT hash_map [ L [ i ] ] += 1 NEW_LINE DEDENT else : NEW_LINE INDENT hash_map [ L [ i ] ] = 1 NEW_LINE DEDENT DEDENT for i in range ( 0 , len ( s ) - size_L + 1 , 1 ) : NEW_LINE INDENT temp_hash_map = hash_map . copy ( ) NEW_LINE j = i NEW_LINE count = word_count NEW_LINE DEDENT