Algorithm · Microsoft · Hard
You are given n server values in an array. Choose exactly k of the servers so that no two chosen servers sit next to each other in the array. Among all valid ways of choosing, find the one whose largest chosen value is as small as possible, and return that smallest possible largest value. Example 1: Explanation: Choose the first and third servers (values 2 and 5); the largest chosen value is 5. Interview Notes This task is presented with servers in place of houses. It…