Reverse Bits | LeetCode 190 | C++, Java, Python

Поделиться
HTML-код
  • Опубликовано: 19 сен 2024
  • LeetCode Solutions: • LeetCode Solutions | L...
    June LeetCoding Challenge: • Playlist
    May LeetCoding Challenge: • Playlist
    Github Link: github.com/Kno...
    *** Best Books For Data Structures & Algorithms for Interviews:*********
    1. Cracking the Coding Interview: amzn.to/2WeO3eO
    2. Cracking the Coding Interview Paperback: amzn.to/3aSSe3Q
    3. Coding Interview Questions - Narasimha Karumanchi: amzn.to/3cYqjkV
    4. Data Structures and Algorithms Made Easy - N. Karumanchi: amzn.to/2U8FrDt
    5. Data Structures & Algorithms made Easy in Java - N. Karumanchi: amzn.to/2U0qZgY
    6. Introduction to Algorithms - CLR - Cormen, Leiserson, Rivest: amzn.to/2Wdp8rZ
    *****************************************************************************
    July LeetCoding Challenge | Problem 12 | Subsets | 12 July,
    Facebook Coding Interview question,
    google coding interview question,
    leetcode,
    Reverse Bits,
    Reverse Bits c++,
    Reverse Bits Java,
    Reverse Bits python,
    Reverse Bits solution,
    190. Reverse Bits,
    #CodingInterview #LeetCode #JulyLeetCodingChallenge #Google #Amazon #ReverseBits

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

  • @agileprogramming7463
    @agileprogramming7463 4 года назад +11

    This is the real content which gives us the technical skills we need..

  • @ambersinghrok
    @ambersinghrok 4 года назад +8

    hats off!!!.. every single day you show up !!!

    • @KnowledgeCenter
      @KnowledgeCenter  4 года назад +3

      It may not be possible every day in future. But, will be try to do so as much as I can.

    • @harshk3351
      @harshk3351 4 года назад +3

      @@KnowledgeCenter Sir pls solve Graphs problems as much as possible because on youtube there is no much content available on Graphs and Obviously the way you explained is SUPERB, Thankyou so much Sir.!!!

    • @shashankjha4134
      @shashankjha4134 4 года назад +3

      @@KnowledgeCenter please don't say this sir. at least keep posting the solutions of daily challenges.
      after brainstorming for 1 hour even if I solve the problem I wait for your video because you always come up with an extra approach.

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

    Genuinely grateful to u sir. U are seriously better than all online competitive coder on youtube ( most of them just showoff)

    • @raviashwin1157
      @raviashwin1157 4 года назад +3

      Yes bro,wo sirf fake dreams dikhate hain ....aur jab kuch padhane ki bari aati hain kuch nahi padhate

    • @nikhilghodke3422
      @nikhilghodke3422 4 года назад +1

      @@raviashwin1157 exactly bro

    • @KnowledgeCenter
      @KnowledgeCenter  4 года назад +6

      On youtube videos having Tips and Tricks sell more. People are looking for some shortcut, some magic trick. But, there is generally no shortcuts to learning & mastering concepts. One has learn everyday and practice every day. Yes, some guidance and mentoring is required. But, mostly it will be driven by yourself. Your Will.

    • @KnowledgeCenter
      @KnowledgeCenter  4 года назад

      Thanks for compliments.

    • @raviashwin1157
      @raviashwin1157 4 года назад +1

      @@KnowledgeCenter Sir keep doing this job ...we as a subscriber will share your videos and tell our friends about this channel....very few people in today's world really work honestly like you.

  • @rohitgupta7037
    @rohitgupta7037 3 года назад +1

    Very good explanation. I tried to understand this logic in so many videos/code but was not able to follow until I saw this video. Thanks !!!

  • @chetanshrivastava3762
    @chetanshrivastava3762 4 года назад +1

    Very nice explanation sir...first solution which comes to me is to use builtin function..(return int('{:032b}'.format(n)[::-1],2)) which is very easy(convert integer into 32 bits binary,reverse & convert into integer ).

  • @amrholo4445
    @amrholo4445 Год назад +1

    Thanks a lot 💞💞

  • @monojtewari2071
    @monojtewari2071 Год назад +1

    thank you for this amazing explanation

  • @raviashwin1157
    @raviashwin1157 4 года назад +3

    Great job sir 👍

  • @aapoopee1239
    @aapoopee1239 3 года назад +1

    Ty most helpful video on yt!

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

    Nice explanation your videos are really good...please keep on making such videos...you are doing a great job.

  • @AyushRaj-pm1dz
    @AyushRaj-pm1dz 2 года назад

    In the first approach , why are we doing "res

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

    bless

  • @rainethai4357
    @rainethai4357 3 года назад +1

    approach 2 (bit masking) can't be done in java. do you know why?

  • @kalyanreddy3176
    @kalyanreddy3176 3 года назад +1

    Really helpful, keep the good work going on..

  • @gourav.barkle
    @gourav.barkle 3 года назад +1

    Thank you

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

    Nice explanation sir... ❤

  • @devanshsolani2711
    @devanshsolani2711 3 года назад +1

    I hope all of you watching this will be great Software Engineers

  • @Anonymous-ny1yy
    @Anonymous-ny1yy 4 года назад +1

    Great !

  • @ShubhamSharma-xt5ft
    @ShubhamSharma-xt5ft 4 года назад +1

    very good explanation

  • @srivatsav9288
    @srivatsav9288 4 года назад +1

    very intuitive ! what digital pad you use ? can you share the link if possible ?

  • @srujangowda9975
    @srujangowda9975 3 года назад +1

    Take a bow hero.. take a bow!

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

    C++
    bitset x(n);
    auto str = x.to_string();
    std::reverse(str.begin(), str.end());
    auto y = std::bitset(str);
    return (uint32_t) y.to_ulong();
    Java
    String bin=Integer.toBinaryString(n);
    bin=new StringBuilder(bin).reverse().toString();
    return Integer.parseInt(bin,2);
    but same logic not worked in java.
    because java do not have unsigned type :(

    • @KnowledgeCenter
      @KnowledgeCenter  4 года назад +1

      Great, you tried. Thanks for sharing.

    • @KnowledgeCenter
      @KnowledgeCenter  4 года назад +1

      @Prabhat. You don't need to code in multiple languages, you can choose 1 language.

  • @anjanobalesh8046
    @anjanobalesh8046 6 месяцев назад +1

    The second approach complicates everything

  • @XXIcenturyblood
    @XXIcenturyblood 3 года назад

    Thank you !

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

    WD!

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

    i converted the bit to string using bitset and reversed it but how to convert it back to uint?????