Beautiful Array

  • Challenge Author
    + 1 comment

    Sorry, maybe I don't understand your solution... You must check all possible numbers in interval [0...maxAi] for 'median'. You can not check only elements from array. Example :

    2 1 1

    4 2

    Array is: 3 3

    Answer 1