Блог пользователя rhezo

Автор rhezo, история, 8 лет назад, По-английски

How is the test case given in the image for this problem correct? The only possible sets are {9,10,11} or {9,10,12}. None of them have exactly n/2 terms even or odd. The test case is : {4, 321, {6, 12, 2, 3, 9, 8, 10, 5}, {0, 3, 0, 0, 1, 0, 2, 0}}. Please help!

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

n=4 so your set should contain 4 elements instead of 3. It can be {9,10,11,100}.

  • »
    »
    8 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Thanks, didn't think hard enough, there is no condition given for numbers [maximum in upTo array+1, b]. Thanks!