C. Factorials and Powers of Two | Level C | Codeforces Round 774 | Div 2 | Hindi easy explanation

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

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

  • @yashsrivastava5128
    @yashsrivastava5128 2 года назад +2

    which question were you referring to in leetcode related to bitmasking?

    • @BroCoders
      @BroCoders  2 года назад +1

      ruclips.net/video/tk5rwYgBWZc/видео.html

    • @BroCoders
      @BroCoders  2 года назад +2

      ruclips.net/video/1_yfE1YQeQE/видео.html

  • @VishalYadav-gk1kg
    @VishalYadav-gk1kg 7 месяцев назад +2

    Very nice explanation sir, Thank you!

  • @avkumar1764
    @avkumar1764 2 года назад +4

    Nice explanation...with this i also get idea of bit masking...thank you!

  • @manaskumarpanda3343
    @manaskumarpanda3343 2 года назад +2

    mene vi first method se try kia tha ki max contribution ko hi shrif lunga but i got wa in tastcase 2
    by the way nice explation bhiaya

    • @BroCoders
      @BroCoders  2 года назад +2

      Yeah that's why we mentioned it so you know why it won't work.

    • @sanyamwalia3986
      @sanyamwalia3986 2 года назад +1

      Same mai bhi

  • @raunakshalya2118
    @raunakshalya2118 2 года назад +1

    Thank u bhaiya

  • @ankitvermaiitism5700
    @ankitvermaiitism5700 2 года назад +5

    very well Explained...🔥

    • @BroCoders
      @BroCoders  2 года назад +1

      Glad you liked it!

  • @avinashjain227
    @avinashjain227 2 года назад +2

    Good explaination. Thanks.

  • @arpandesai2034
    @arpandesai2034 2 года назад +1

    Just a doubt won't there be a case where we are using 1! and 2^0 at same time....so we used the value 1 2 times which breaks the condition of distinct numbers

    • @BroCoders
      @BroCoders  2 года назад +1

      right...nice thought but aisa kabhi nhi hoga bcoz agar n odd hai and you are considering 1! then after removal number even hojaaega bcoz baaki sab factorial even hota hai (odd-odd=even) now even number mai you cant take 2^0 and vice versa..

    • @arpandesai2034
      @arpandesai2034 2 года назад +1

      @@BroCoders but if n is even and we use 1! so the resulting value i.e (n-factorial_sum) will also be odd...so expressing odd value as sum of power of two will force us to use 2power0 = 1 again...so we will be using 1 two times right

    • @BroCoders
      @BroCoders  2 года назад +1

      @@arpandesai2034 but that wont be minimum right?

  • @sarthakgokhale7367
    @sarthakgokhale7367 2 года назад +1

    biult-in popcount (n-sum) aslo got accepted

  • @AkashKumar-lr6hc
    @AkashKumar-lr6hc 2 года назад +1

    Awesome implementation..

  • @sahilanand30
    @sahilanand30 2 года назад +2

    Nicely explained

    • @BroCoders
      @BroCoders  2 года назад +1

      Thank you so much 🙂

  • @secretpositron8626
    @secretpositron8626 2 года назад +2

    Nice explanation 👏

  • @abhinavsingh9720
    @abhinavsingh9720 2 года назад +1

    Thanks

  • @abhishekjaiswal2575
    @abhishekjaiswal2575 2 года назад +1

    for (int i = 1; i < 14; i++) fact[i] = (i + 1) * fact[i - 1]; factorial nikalte time i*fact[i-1] ku ni kiya?

    • @BroCoders
      @BroCoders  2 года назад

      Bcoz mai 0 based indexing liya hun😊

    • @abhishekjaiswal2575
      @abhishekjaiswal2575 2 года назад

      Still agr hmm fact[0]=1 kiye h then 1 se iterate krege toh i* fact[i-1] toh shi calculate krega na toh i+1 ku use kiye h?

    • @BroCoders
      @BroCoders  2 года назад +1

      0 mai 1 ka factorial stored hai toh 1 mai 2 ka factorial store hogana

    • @abhishekjaiswal2575
      @abhishekjaiswal2575 2 года назад +1

      @@BroCoders okie smhj gya logic 👨‍💻 thank you😊

  • @unknown_coder7960
    @unknown_coder7960 2 года назад +2

    Aisa content kaha se laate ho bhaiya???❤️🔥❤️

  • @sarthakgokhale7367
    @sarthakgokhale7367 2 года назад

    why did you kept the first loop from 0 to 1

    • @BroCoders
      @BroCoders  2 года назад

      Basically I iterated over all the masks possible which I explained 5 mins before , will recommend to watch the last 10 mins again.

    • @sarthakgokhale7367
      @sarthakgokhale7367 2 года назад

      @@BroCoders thanks for quick response

  • @cokewithcode
    @cokewithcode 2 года назад +1

    ram ram bhaiyaa ❣️

    • @cokewithcode
      @cokewithcode 2 года назад +1

      Jai shree radhe krishna ❣️

    • @cokewithcode
      @cokewithcode 2 года назад +1

      hare Krishna❣️

    • @BroCoders
      @BroCoders  2 года назад +2

      @@cokewithcode Radhe Radhe!!

  • @tahsinanzum466
    @tahsinanzum466 2 года назад +1

    Can you please work on your audio.

    • @BroCoders
      @BroCoders  2 года назад +2

      Yes, we have to .... actually the mic is a bit hasy and (the speaker even spoke a bit faster). We'll take care next time..........