You are configuring a neural network consisting of N layers.
Initially, the i-th layer is placed at coordinate i.
Each layer has a unique efficiency value given by the array efficiency[].
For every layer i, you are also given an integer incremental[i].
In one operation, you may move layer i from its current coordinate x to x + incremental[i].
You may perform this operation any number of times on any layer.
After all operations, consider the layers ordered by their final coordinates (from smallest to largest). Their corresponding efficiency values must be strictly increasing.
Find the minimum total number of operations required.
It is guaranteed that a solution always exists.
N efficiency1 efficiency2 ... efficiencyN incremental1 incremental2 ... incrementalN
Print the minimum number of operations required.
Expert in Data Structures & Algorithms. Building tools to help developers crack FAANG interviews.