This is a verified interview question from Goldman-sachs. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Neural Layer Reordering - Goldman Sachs Online Assessment IIIT Allahabad" covers key patterns like Other.
"### Problem 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. ### Input N efficiency1 efficiency2 ... efficiencyN incremental1 incremental2 ... incrementalN ### Output Print the minimum number of operations required."
Join thousands of developers practicing for Goldman-sachs.