Algorithm · Apple · Medium
Alias Grouping Medium · Topics · Company Tags · Hints You are given a list of string pairs pairs, where each entry is a two-element list [word1, word2]. A pair indicates that word1 and word2 are aliases—they refer to the same concept. This alias relationship is symmetric: whenever a is an alias of b, b is also an alias of a. It is also transitive: if a and b are aliases, and b and c are aliases, then a and c are aliases as well. Your task is to partition all the words into…
Checking your access…