Pergunta de entrevista da empresa Jio

I was asked write a code for anagram words