Company: Deshaw_13oct
Difficulty: medium
Save Components from Infection Problem Description There are n software components arranged in a circular network, labeled from 1 to n . Each component relies on its neighboring components to function, meaning component 1 and 2 are neighbors, component 2 and 3 are neighbors, and so forth, with component n also connected back to component 1 to complete the circle. Initially, m of these components have been infected by a malicious bug. Each day, the lead developer can "patch" one uninfected component, making it permanently immune to the bug. Every day, the following sequence of events unfolds: The lead developer selects an uninfected component and patches it, making it permanently bug-free. All remaining unpatched and uninfected components with a neighboring infected component get infected by the bug. The developer's goal is to prevent as many components as possible from being infected. Given an integer n representing the total number of software components in the network and an integer