Anon123
BAN USER
Questions (2)
Reputation 120
- 5of 5 votes
AnswersYou are given an array of n elements. The elements have are n-bit long too.
- Anon123 in United States
Now n here represents the number of employees in a company. Element with index 0 is information about employee 0, at index 1 is information of employee 1....
For each element, the bits represent whether that employee works (not same team... just works) with employee at that index.
Ex. element 0 = 0110 => emplyee 0 works with employee 1 and 2
element 1 = 1001 => emplyee 1 works with employee 0 and 3
...
Put employees in groups in which they work. The transitive property is applicable here i.e. if A works with B and B works with C, ABC will be in one group.
The solution needs to efficient in terms of run time and memory. I hope the above is clear.| Report Duplicate | Flag | PURGE
Microsoft Algorithm
Page:
1
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.