Algorithm · Goldman Sachs · Medium
Requirements You are given an integer array difficulty; each entry difficulty[i] represents the difficulty rating of a single software module. Distribute every module among precisely three servers. A module may go to only one server, and no server may be left empty. After a partition is chosen, pick one module from each server and evaluate d1 - d2 + d2 - d3 . Choose those three modules so that this quantity is as small as possible. Among every permitted partition, return the…
Checking your access…