Beautiful Array

  • Challenge Author
    + 1 comment

    Answer doesn't have to be median number. Look at following example :

    4 10 1

    3 3 7 6

    Optimal solution for beautiful array is :

    7 7 7 7

    Answer 9.