Python Program to Minimize the maximum difference between the height