Ad
  • Custom User Avatar

    Why test for two elements passes with something like that?

    if(numbers.size() == 2)
      return 0;
    

    Author decided that there are one max and one min values, for example {3, 10}, so result is 0, because we exclude max and min values in answer.
    Though, an array {3, 3} possible too. And answer should be 3.