Codechef Starters 152 | Video Solutions - A to D2 | by Abhinav Kumar | TLE Eliminators

Поделиться
HTML-код
  • Опубликовано: 9 ноя 2024

Комментарии • 14

  • @TLE_Eliminators
    @TLE_Eliminators  Месяц назад

    Please fill the Feedback form for PCD: forms.gle/khJnidNRCZCbDjjY9

  • @SelvaArumugam-xq5mf
    @SelvaArumugam-xq5mf Месяц назад +1

    3rd question the way you explained was amazing man

  • @abhinavkumar4375
    @abhinavkumar4375 Месяц назад

    well explained . Thank you bro

  • @sangdilbiswal30
    @sangdilbiswal30 Месяц назад +1

    Thnks bro 4th explanation is great

  • @shubhambhatt6913
    @shubhambhatt6913 Месяц назад +1

    well explained

  • @kondekarvaishnavi2348
    @kondekarvaishnavi2348 Месяц назад

    For 3rd qs.
    If my array is something like 1 1 2 2
    Nd my query is 1 4
    Ans as per ur idea is yes
    But it doesn't follow for every cyclic rotation right. Am i missing something

    • @abhinavkumariitism
      @abhinavkumariitism Месяц назад

      You can rearrange it like,
      1 2 1 2
      Now, this is anti-palindrome for all cyclic shifts.

    • @kondekarvaishnavi2348
      @kondekarvaishnavi2348 Месяц назад

      @@abhinavkumariitism rearrange mean we can shuffle them as per any order or we can rearrange them only by shifts

    • @kondekarvaishnavi2348
      @kondekarvaishnavi2348 Месяц назад

      @@abhinavkumariitism rearrange mean we can shuffle them as per any order or we can rearrange them only by shifts

    • @abhinavkumariitism
      @abhinavkumariitism Месяц назад

      ​@@kondekarvaishnavi2348
      Rearrange means you can shuffle in any order.
      In the question it is asked, that you can shuffle the array in any way, so that you obtain a rearrangement, which is *anti-palindrome for all its cyclic shifts.*
      So 1st you have to rearrange.. then, check if that rearrangement gives anti-palindrome even after cyclic shifts..
      I hope you got it.

  • @kumkumslab5811
    @kumkumslab5811 Месяц назад

    in the third question u have said array is beautiful if all the cyclic rotation is should be anti-palin but if it so then
    the approach will wail in this
    4
    2,3,3,1
    ans is yes how ?
    a[1]=a[2] so it is not beautiful

    • @n0obSniper-k5l
      @n0obSniper-k5l Месяц назад +1

      bcoz we are allowed to rearrange the elements, [2,3,1,3] will be beautiful by rearranging the original array

    • @abhinavkumariitism
      @abhinavkumariitism Месяц назад +2

      You can rearrange it like this,
      3,2,3,1
      Then, in this case all the cyclic shifts are anti-palindrome, so it is beautiful.

    • @kumkumslab5811
      @kumkumslab5811 Месяц назад +1

      @@abhinavkumariitism ok thanks it is then quite easy