Company: Amazon SDE on-campus_28april
Difficulty: medium
In a large fulfillment center's robotics system, a fleet of robots operates at the same time to move packages around efficiently. Each robot can be in one of two states: Standby or Operating. To keep coordination smooth, every robot i has a predefined coordination threshold, coordinationThreshold[i] , which decides when that robot ends up malfunctioning: A robot i malfunctions if it is in the Operating state but the total number of other robots in the Operating state is less than coordinationThreshold[i] . A robot i malfunctions if it is in the Standby state but the total number of robots in the Operating state is greater than or equal to coordinationThreshold[i] . The system is considered unstable the moment even one robot malfunctions. Return how many distinct valid configurations exist where no robot ever malfunctions. Note: A configuration is an assignment of each of the n robots to either Operating or Standby. A configuration is considered valid if no robot mal f unctions under th