I have below scenarios where I need to check each ID and see if the HC can fit into the given capacity and if it does, have to merge and if it doesnt leave it as is.
City |
ID |
Capacity |
Headcount |
New Headcount |
Dallas |
1 |
100 |
90 |
100 |
Dallas |
2 |
50 |
10 |
0 |
Dallas |
3 |
30 |
30 |
30 |
Ohio |
1 |
50 |
40 |
40 |
Ohio |
2 |
40 |
30 |
30 |
Ex: Dallas has 3 ID's where ID 1 has capacity of 100 and Headcount is 30, here I can merge Headcount from ID 2 to ID 1 and leve ID 3 Headcount as is because if I merge ID 3 Headcount, it will be greater than the capacity of ID 1.
Ex: Ohio - Heacount will remain as is as Capacity is limited and if I merge Headcount will become greater than the given capacity.
How can I achieve this ?
@rwunderlich @Vegar @Digvijay_Singh