You are given an integer array prices of length n, representing the prices of various chocolates, and a queries, where queries[i]
For each query, Bob must choose exactly prices. Alice and Bob share the cost of each selected chocolate with price
If
If
The relative loss of a purchase is defined as the total amount Bob pays minus the total amount Alice pays across all
Return an array of integers representing the minimum possible relative loss Bob can achieve for each query.
Constraints:
prices.length
prices[i]
queries.length
queries[i].length
You are given an integer array prices of length n, representing the prices of various chocolates, and a queries, where queries[i]
For each query, Bob must choose exactly prices. Alice and Bob share the cost of each selected chocolate with price
If
If
The relative loss of a purchase is defined as the total amount Bob pays minus the total amount Alice pays across all
Return an array of integers representing the minimum possible relative loss Bob can achieve for each query.
Constraints:
prices.length
prices[i]
queries.length
queries[i].length