Inventory Processes Survival Possibility
Learn this problemProblem statement
Within Amazon’s vast fulfillment system, there exist n distinct inventory tasks, each operated by bots[i] bots. These tasks compete, leading to conflict rounds every minute where two random tasks are chosen.
During each conflict:
This sequence continues until only one inventory task remains active.
Your objective is to determine which of these tasks have a chance to survive as the final remaining task in at least one possible sequence of events.
Return the 1-based indices of all such tasks, and also please sort it in ascending order 📈.
p.s. if you are applying for a L5 position, you may not want to miss this question..🤧
Gooood news! We might found the shoe selling question: Selling Shoes
The second question in the same batch..Will update once find reliable source..like always~~
Function
inventoryProcessesSurvivalPossibility(n: int, bots: int[]) → int[]Examples
Example 1
n = 5bots = [1, 6, 2, 7, 2]return = [2, 4]