Question d’entretien chez Jio

I was asked write a code for anagram words