Amazon OA
Anonymous User
5370

Took an online test today.

Q1 was about given an Array of numbers, for example {5, 1, 2, 1, 4, 5} which represent skills of employees..(Skills[i])
How many teams you can form, given the Teamsize = 3 and MaxDiff = 2 which is the maximum difference allowed in skills

Example 1 = With {5, 1, 2, 1, 4, 5} and given Teamsize = 3 and MaxDiff = 2. You can form 2 teams [2, 1, 1] and [4, 5, 5].
Example 2 : 0 teams can be formed with [9, 3, 5, 7, 1] and int teamSize = 2; int maxDiff = 1

Comments (7)