Google | SWE | Telephonic Round | 12th August

Google · Question · Posted Aug 2020

Score of an array of integers is defined as X-Y where X is maximum of all elements in array and Y is minimum of all elements in array. You are allowed only once to pick one consecutive subarray of size K of A[] and delete it forever. Remaining numbers will form new array in same order. Find minimum possible score for a given array A[] of size N.

The full answer & interview discussion are available to premium members.

Log in Create a free account