Map stores the words present in list L against it 's occurrences inside list L
unordered_map < string , int > hash_map ; for ( int i = 0 ; i < word_count ; i ++ ) hash_map [ L [ i ] ] ++ ; for ( int i = 0 ; i <= S . size ( ) - size_L ; i ++ ) { unordered_map < string , int > temp_hash_map ( hash_map ) ; int j = i , count = word_count ;