E. Beautiful Array (Codeforces Round 954 (Div. 3) )

Поділитися
Вставка
  • Опубліковано 26 сер 2024
  • Please speed up to 1.5X
    Code link: codeforces.com...
    #leetcode #codeforces #codeforces #programming #cp

КОМЕНТАРІ • 3

  • @shubhamtanwar7039
    @shubhamtanwar7039 2 місяці тому

    great explaination

  • @shivamshrivastava5636
    @shivamshrivastava5636 2 місяці тому

    Sir in case one of the values contains an odd number of elements, we have to ignore one of the elements. My intuition was to two create two cases: In the first case we will ignore the smallest element of the set and in the second case we will ignore the largest element of the set, we will take the minimum of the two cases in our answer. However, my approach is failing on some of the test cases.

    • @soumyabhattacharjee1051
      @soumyabhattacharjee1051  2 місяці тому

      Consider the case 1 3 9 15 17
      Here we have to ignore 9 which is neither max or min
      Please subscribe if you find this helpful