← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
Given an array of strings strs, group all anagrams together into sublists. You may return the output in any order.
An anagram is a string that contains the exact same characters as another string, but the order of the characters can be different.
Input: strs = ["eat", "tea", "tan", "ate", "nat", "bat"]
Output: [["ate","eat","tea"],["nat","tan"],["bat"]]
Input: strs = [""]
Output: [[""]]
Input: strs = ["a"]
Output: [["a"]]
1 <= strs.length <= 10^40 <= strs[i].length <= 1000