Company: Zeta_26june
Difficulty: medium
Optimal Item Distribution Game Problem Description An individual, whom we shall refer to as Player A, has a set of n items, each associated with a positive weight represented by the values arr[i] , where i ranges from 1 to n. Player A has at their disposal three distinct containers, labeled 1 to 3, which are initially empty. Player A's objective is to allocate these items into the containers, ensuring that each container contains at least one item. Subsequently, another individual, whom we shall refer to as Player B, will be tasked with selecting one item from each of the three containers. Let's denote the weight of the item selected from container j as wj . The score, which quantifies the outcome, will be determined by summing the absolute differences between the weights of the items. Player B selects from each container. The scoring formula is given as |w1 - w2| + |w2 - w3| , where |x| represents the absolute value of x . It is a known fact that Player B will strategically select the