Amazon manages a warehouse with sequentially numbered product slots starting from 1. You are given an array inventory[] where inventory[i] is the product ID in ith slot. A perfect slot is a slot where the product ID equals its slot number.
You are allowed to perform the following operation any number of times (possibly zero):
Determine the maximum number of perfect slots achievable after any number of removals.
Quickshell Backend • Pending