231. Power of Two | Bit Manipulation | Remove Last Set Bit

  Рет қаралды 1,075

Aryan Mittal

Aryan Mittal

Күн бұрын

In this video, I'll talk about how to solve Leetcode 231. Power of Two | Bit Manipulation | Remove Last Set Bit
Checkout DSA-169 Series: • Aryan DSA-169 Series |...
100Days 100k Placements: • 100 Days 100K Placement
Let's Connect:
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / ez.pz.dsa
📱Telegram : t.me/aryan_mit...
🤖 Github: github.com/ary...
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Timelines✨
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Пікірлер: 14
@mridul.7183
@mridul.7183 6 ай бұрын
another bit approach : if n is a power of 2 it will only have one set bit. and the number n-1 will have all other bit as 1 except this one . eg n=8, n=1000 and n-1=7=0111 thus (n&(n-1)) will give us 0 if n is power of two.
@prakashpratapsingh7323
@prakashpratapsingh7323 6 ай бұрын
I think this is the best solution for the question
@dartiniz6136
@dartiniz6136 6 ай бұрын
naah i tried your approach but not all testcase pass i get it why its not right approach but its hard to explain via typing
@prakashpratapsingh7323
@prakashpratapsingh7323 6 ай бұрын
bool isPowerOfTwo(int n) { if(n==0){ return false; } long long x = n; return (x & x-1)==0; } Try this....
@dartiniz6136
@dartiniz6136 6 ай бұрын
my bad, i didnt consider
@dartiniz6136
@dartiniz6136 6 ай бұрын
@@prakashpratapsingh7323 if(n
@yashparashar6781
@yashparashar6781 6 ай бұрын
10:10 Two's complement of 0100 is 1100
@awkward_adi
@awkward_adi 6 ай бұрын
Can you please make a video on weekly contest's question number 4
@mohammadibegum9216
@mohammadibegum9216 6 ай бұрын
Hi sir I know DSA but as I am from a tier 3 college I have not done projects on my own im my college now I am unable to explain it in interviews.. So what should I do ..can we get videos of how to do a Project??
@brawlstarsac3574
@brawlstarsac3574 6 ай бұрын
build some projects dude.. Only DSA won't help me unless you are really great in it. Start from today from any domain, and build some projects
@shashanksahu9230
@shashanksahu9230 6 ай бұрын
Weekly Contest 385 solution?????
@fraserdab
@fraserdab 6 ай бұрын
Oh no a bit manipulation week? 😢
@ARYANMITTAL
@ARYANMITTAL 6 ай бұрын
After watching this , you will be able to understand Fenwick 🌳 - kzbin.info/www/bejne/h5abooWer5ifsLM
@Lucifer0872
@Lucifer0872 6 ай бұрын
Bhaiya 2024 batch ka hu job nahi mil raha kya karu
English or Spanish 🤣
00:16
GL Show
Рет қаралды 15 МЛН
Magic or …? 😱 reveal video on profile 🫢
00:14
Andrey Grechka
Рет қаралды 53 МЛН
Fenwick Tree Complete | Point Update & Range Query | Part - I
44:04
you will never ask about pointers again after watching this video
8:03
Low Level Learning
Рет қаралды 2,2 МЛН
Power of two 🔥 | Leetcode 231 | Bit Manipulation | 4 approaches
9:44
80's Remix: Battle for Permission to Meet Ten Theme Song
1:43
PS3tronic
Рет қаралды 376 М.
BFDI: "Hey Two!" - Animated
3:16
p0tatomango
Рет қаралды 1,8 МЛН
The Last Algorithms Course You'll Need by ThePrimeagen | Preview
16:44
Frontend Masters
Рет қаралды 317 М.
Power of Two - Leetcode 231 - Python
12:42
NeetCodeIO
Рет қаралды 14 М.
How to Start Leetcode (as a beginner)
8:45
Ashish Pratap Singh
Рет қаралды 845 М.
English or Spanish 🤣
00:16
GL Show
Рет қаралды 15 МЛН