Amazon | SD2 | Phone | Grouping strings
Anonymous User
1258

I' just had interview for Amazon São Paulo - Brazil SD2 position. the guys was very calm and did some asks about big O, priorityqueue and hashtable. At the end of problem, he'd ask about time complexity

The problem:

// Given an array of string, group the strings that are composed by the same character, returning an array of arrays.

// For example, given:
//["124", "412", "425", "241", "524", "324", "2141"],

//Return:
// [
// ["241", "124","412"],
// ["524","425"],
// ["324"],
// ["2141"]
// ]

Comments (5)