Leetcode 1599. Maximum Profit of Operating a Centennial Wheel
Simulate the wheel: process arrivals and greedily board up to 4 waiting customers each rotation while tracking cumulative profit = boarded*boardingCost − rotations*runningCost, and return the rotation count that yields the maximum profit (or -1 if the profit never becomes positive).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.