Zomato | SDE | 15 December

Zomato · Question · Posted Apr 2020

Given an array of strings, return all groups of strings that are anagrams. Represent a group by a list of integers representing the index in the original list. Look at the sample case for clarification. Anagram : a word, phrase, or name formed by rearranging the letters of another, such as 'spar', formed from 'rasp' Input : cat dog god tca Output : [[1, 4], [2, 3]]

The full answer & interview discussion are available to premium members.

Log in Create a free account