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

preview_player
Показать описание

**** Best Books For Data Structures & Algorithms for Interviews:**********
*****************************************************************************

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
Рекомендации по теме
Комментарии
Автор

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

agileprogramming
Автор

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

ambersinghrok
Автор

In the first approach, why are we doing "res <<= 1" before hand instead of doing it at the last of the loop??

AyushRaj-pmdz
Автор

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

nikhilghodke
Автор

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 ).

chetanshrivastava
Автор

The second approach complicates everything

anjanobalesh
Автор

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 !!!

rohitgupta
Автор

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

srivatsav
Автор

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

rainethai
Автор

thank you for this amazing explanation

monojtewari
Автор

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

paragroy
Автор

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

devanshsolani
Автор

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

GokuVidhayak
Автор

C++
bitset<32> x(n);
auto str = x.to_string();
std::reverse(str.begin(), str.end());
auto y = std::bitset<32>(str);
return (uint32_t) y.to_ulong();

Java
String
bin=new
return Integer.parseInt(bin, 2);

but same logic not worked in java.
because java do not have unsigned type :(

prabhatchanchal
Автор

Really helpful, keep the good work going on..

kalyanreddy
join shbcf.ru