Given a sequence of words, print all anagrams together using STL
Given an array of words, print all anagrams together. For example, Input: array = {“cat”, “dog”, “tac”, “god”, “act”}output: cat tac act, dog godExplanation: cat tac and act are anagrams and dog and god are anagrams as they have the same set of characters.Input: array = {“abc”, “def”, “ghi”}output: abc, def, ghiExplanation: There are no anagrams in