Tiny Interview: C++ Anagrams

Anagrams are words created from the rearrangement of another word. For this tiny interview, you are to implement a function which takes a list of words as an argument and finds all anagrams within the list.
Please check the sandbox for further instructions:
Tiny interview solution
Verify your solution with the official solution in this sandbox.
Want to conduct interviews on this platform?
Check out CoderPad : pick any interview question or create your own, then invite your candidate to a shared live-coding session on an IDE like this one. You even get 2 free interviews per month forever using this registration link!