Today, we’re solving the HackerRank challenge, Max Min.
The problem statement reads:
You will be given a list of integers as an integer array, “a-r-r”, and a single integer, “k”. You must create an array of length, “k”, from the elements in the integer array, such that unfairness is minimized. We’ll call that array, “suba-r-r”. Unfairness of an array is calculated as follows:
The maximum value, or the largest integer in the subarray subtracted by the minimum value, or the smallest integer in the subarray.
As an example, consider the array [1-4-7, and 2], and k equals 2. Picking the values 4 and 7, with the maximum value being 7, and the minimum value being 4: unfairness = 3. Testing for all pairs: the solution [1 and 2], provides the minimum unfairness.
Closed Captions/Subtitles - ed2clark@gmail.com
Video Editing - ed2clark@gmail.com
Song: All Night - Ikson (Vlog No Copyright Music)
Music promoted by Vlog No Copyright Music.
/ ikson
Auf dieser Seite können Sie das Online-Video Max Min Java Coding Challenge | HackerRank | How'd You Code That? mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Ed Clark 25 Juli 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,634 Mal angesehen und es wurde von 60 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!