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

Поделиться
HTML-код
  • Опубликовано: 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