Maximum XOR for Each Query | Leetcode 1829

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

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

  • @bhavanbharadwaj7901
    @bhavanbharadwaj7901 2 месяца назад +1

    thanks a lot!!

  • @ashishsharma2341
    @ashishsharma2341 2 месяца назад

    Nice explanation

  • @AfrinJahanBME
    @AfrinJahanBME 2 месяца назад

    Nice explanation 👏👏

  • @fightermad
    @fightermad 2 месяца назад

    Thanks so much

  • @sailendrachettri8521
    @sailendrachettri8521 2 месяца назад +1

    Thank you :) :)

  • @ssquare1
    @ssquare1 2 месяца назад

    👏👏

  • @devmahad
    @devmahad 2 месяца назад

    thanks :)

  • @21flame72
    @21flame72 2 месяца назад

    3:19 why 2^7 could you explain that part was not clear

    • @techdose4u
      @techdose4u  2 месяца назад +1

      We will try all possible values from 0 to 2^maxBits-1 for bruteforce.
      Later I have explained why 7 works in optimal solution :)
      Using Bitmasking.

  • @ayushjaiswal997
    @ayushjaiswal997 2 месяца назад +1

    how did you pic value of k = 101 = 5 that is less that 8 instead of 010 = 2 which is xor_result of all array element or why not 3,4,5,6,7. Is it Hit and Trial method or any logic behind it. if yes then please explain.

    • @techdose4u
      @techdose4u  2 месяца назад

      timestamp ?

    • @ayushjaiswal997
      @ayushjaiswal997 2 месяца назад

      @@techdose4u 2:25

    • @techdose4u
      @techdose4u  2 месяца назад +1

      It is explained ahead in operation strategy part.
      This is just an example and not solution.
      The Xor maximizing strategy will tell uou the answer explained ahead.
      It is based on Xor property.
      It is not trial method.

  • @anjali3063
    @anjali3063 2 месяца назад

    but what if after masking i got number which is greater than range of k

    • @techdose4u
      @techdose4u  2 месяца назад

      It is impossible as the contraint mentions all array items are less than equals to max value of K.

  • @anyapatel50
    @anyapatel50 2 месяца назад +1

    "Thank you for the solution, sir. I have a question: should I solve the daily challenge, or are there specific questions I should focus on because in my college there is no campus placement no guidence 😞?"

    • @techdose4u
      @techdose4u  2 месяца назад

      You should defnitely solve POTD (daily challenge).
      Moreover, you must practice a techstack.
      Popularly followed is fullstack.
      You can ping me on LinkedIn for more questions.

  • @scientificabhishek4332
    @scientificabhishek4332 2 месяца назад

    please make videos in java also so java people can also understand

    • @techdose4u
      @techdose4u  2 месяца назад +1

      Java code is present in code.
      C++
      Java
      Python

  • @ZahiidKhan262
    @ZahiidKhan262 2 месяца назад +2

    I am not able to understand 🥲🥲

    • @techdose4u
      @techdose4u  2 месяца назад +1

      Please watch.
      you will; definitely :)