Max Min, is a HackerRank problem from Greedy Algorithms subdomain. In this post we will see how we can solve this challenge in C++

Problem Description

You will be given a list of integers, , and a single integer . You must create an array of length from elements of

such that its unfairness is minimized. Call that array . Unfairness of an array i ....

You can find the full details of the problem Max Min at HackerRank

Solution: Please check the solution.cpp snippet for the solution.

Solution originally posted at: Github by @marinskiy