BrowserStack interview question

Basic java programms like string anagram, with multiple approaches