When we make 1st, 2nd, 3rd, and 4th employees on table-1 and 5th on table-2 Number of people getting into arguments = 2 (two 3’s: 4th and 5th employee) When we make 1st, 2nd, and 3rd employee on table-1 and 4th and 5th on table-2 Now let’s check all the combinations and how in-efficient is all of them. Given the number of employees, N, and their salaries in array a, he wants to find the optimal inefficiency, i.e., the smallest possible value for the inefficiency of arranging the N employees. Mike came across the term inefficiency of arrangement, which can be defined as the sum of the cost of tables + the total number of people getting into arguments. The only problem is that the employees with the same salary can get into arguments which can ruin the party. All the employees have to seat in the order of the index. Let’s say the cost of renting each table is K. But he is a little thrifty in that, he wants to adjust everyone in as few tables as he can. Mike has to arrange tables, where he will accommodate everyone. We will represent salary by an integer value. In this startup, everyone knows each other’s salary. These employees are indexed with an array starting from 1 to N. He has invited all of his fellow employees who are N in number. Mike has arranged a small party for the inauguration of his new startup. TCS Coding Question Day 1 Slot 1 – Question 1
0 Comments
Leave a Reply. |