Generate All Possible Subsets | Return Power Set | Leetcode 78. | Bit Manipulation | Two for loops

  Рет қаралды 39,615

Code with Alisha

Code with Alisha

Күн бұрын

Given an integer array nums of unique elements, return all possible subsets (the power set).
The solution set must not contain duplicate subsets. Return the solution in any order.
Example 1:
Input: nums = [1,2,3]
Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]
Example 2:
Input: nums = [0]
Output: [[],[0]]
Connect with me on LinkedIn : / alisha-parveen-80579850
Check out our other playlists:
Dynamic Programming:
• Dynamic Programming
Trees:
• Trees
Heaps and Maps:
• Heaps and Maps
Arrays and Maths:
• Arrays and Maths
Bit Manipulation:
• Bit Manipulation
Greedy Algorithms:
• Greedy Algorithms
Sorting and Searching:
• Sorting and Searching
Strings:
• Strings
Linked Lists:
• Linked Lists
Stack and Queues:
• Stacks and Queues
Two Pointers:
• Two pointers
Graphs, BFS, DFS:
• Graphs, DFS, BFS
Backtracking:
• Backtracking
Non- DSA playlists:
Probability:
• Probability
SQL-Basic Join functions:
• SQL - Basic JOIN Funct...
SQL-Basic Aggregate functions:
• SQL-Basic Aggregate Fu...

Пікірлер: 50
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Time Complexity : O(N*2^(N)) int n = nums.size(); // n=3 -> 2^3 = 8 for(int i=0;i
@joelduran9344
@joelduran9344 Жыл бұрын
How can this be written in Java?
@eyadhantoly5796
@eyadhantoly5796 Жыл бұрын
@@joelduran9344 import java.util.*; public class Main { public static void main(String[] args) { int []input = {1, 2, 3}; ArrayList arrayList; ArrayList solution = new ArrayList(); for (int i = 0; i
@Codro09
@Codro09 7 ай бұрын
I saw 2-3 videos before and I didnt understand their solution but as you started to explain the code I coded myself. Thanks maam for your solution.
@satyamgupta6030
@satyamgupta6030 Жыл бұрын
I solved it by my own just came here to see ur solution and I again learnt something new thanks alisha I only prefer ur videos.
@jonlombardi1216
@jonlombardi1216 5 ай бұрын
I appreciate your speed personally, thank you for making an informative video with clear examples as you went step by step.
@tarunpatel1457
@tarunpatel1457 6 ай бұрын
very well explained,👏 today i learnt a new approach of this question.
@aviral1430
@aviral1430 2 жыл бұрын
Ma'am wouldn't it be better if we initialise the vector as vectorv = { }; since there won't be any garbage value in it
@shrawan7624
@shrawan7624 3 ай бұрын
Thanks u have given very clear explaination
@devangrathod6763
@devangrathod6763 7 ай бұрын
Finally found a better explanation and solution, thanks @code with Alisha
@vinayjoshi8714
@vinayjoshi8714 Ай бұрын
amazing explanation dii 😊
@sanketdatta9874
@sanketdatta9874 5 ай бұрын
Thanks. Really nice and detailed explanation
@kaustubhsonar4613
@kaustubhsonar4613 8 ай бұрын
I spend 1 hr behind this problem made the spaghetti of it And code here to see this Well this is new approach to me Thanks teacher
@TON-108
@TON-108 Жыл бұрын
Thank you, very well explained
@maheshj01
@maheshj01 6 ай бұрын
Great explanation but theres a small correction at 06:50 for i = 3 (011) you are going to take [2, 3]
@Daddy30011
@Daddy30011 5 ай бұрын
no
@Rakshit_Jain
@Rakshit_Jain Жыл бұрын
can't be better than this!👍
@UECMadhurendraKumar
@UECMadhurendraKumar 11 ай бұрын
Nice explanation
@sanskarkumar028
@sanskarkumar028 Жыл бұрын
very clear explanation. thank you didi.
@111rhishishranjan2
@111rhishishranjan2 Жыл бұрын
Great , finally found subset using power set
@ganeshjaggineni4097
@ganeshjaggineni4097 7 ай бұрын
NICE SUPER EXCELLENT MOTIVATED
@KomalKanwarRathore-oy3yv
@KomalKanwarRathore-oy3yv Жыл бұрын
thanks for the video it very clear explanation🙂
@khushil9988
@khushil9988 6 ай бұрын
hi alisha it would be more easy to understand if you dry run your code on wb and then explain
@rahulchoudhary7903
@rahulchoudhary7903 2 жыл бұрын
ma'am how "i" number is converted to binary number
@RAMKUMAR-eb1kq
@RAMKUMAR-eb1kq Жыл бұрын
same doubt i too had
@codewithcoffe24
@codewithcoffe24 Жыл бұрын
Well explained. Thank You
@user13443fg
@user13443fg 8 ай бұрын
Very helpful
@AmanSharma-vb5jl
@AmanSharma-vb5jl 2 жыл бұрын
back with a bang!
@sunshineandrainbow5453
@sunshineandrainbow5453 10 ай бұрын
Very helpful di. Thanks a lot. Just a small doubt about how (1
@shreyash_17_
@shreyash_17_ 9 ай бұрын
while doing (1
@sunshineandrainbow5453
@sunshineandrainbow5453 9 ай бұрын
@@shreyash_17_ thanks
@HARSHRAJ-wz2rp
@HARSHRAJ-wz2rp Жыл бұрын
thank you mam
@jayeshchaurasiya262
@jayeshchaurasiya262 2 жыл бұрын
Love you mam ❤️
@rajukachori9536
@rajukachori9536 6 ай бұрын
thanku
@sourabhh_garg
@sourabhh_garg Жыл бұрын
Thanku didi
@KarthikDances
@KarthikDances 3 ай бұрын
Which app u use for screen recording
@RAMKUMAR-eb1kq
@RAMKUMAR-eb1kq Жыл бұрын
mam can you explain how decimal been converted to bits in c++;
@dunno-momoiro123
@dunno-momoiro123 Жыл бұрын
THANK YOU! 🥲🥲😇
@Star_Bawa9
@Star_Bawa9 2 жыл бұрын
Good solution
@rajasharma4598
@rajasharma4598 2 жыл бұрын
W for explainng
@mrinalmadhav8119
@mrinalmadhav8119 2 жыл бұрын
Hi alisha
@sumanshuborkar5788
@sumanshuborkar5788 2 жыл бұрын
🤣
@prakhaxr
@prakhaxr Жыл бұрын
Hoshiyar aunty !!
@Um3n14
@Um3n14 2 жыл бұрын
the grid above is a 3*5 grid. This grid has four infected patients at position (0,0), (0,3), (1,3) and (2,3). Patient at (0,0) will most likely infect recovering patient at (1,0) and (0,1), infected patient (0,3) will most likely infect recovering patient (0.4), infected patient (1,3) will infect both recovering patient at (1,2) and (1,4). And lastly, infected patient (2,3) will infect recovering patient (2,4). Total number of recovering patients infect is 6. For the first round of infection, one unit of time will be recorded. For the second round of infection, recovering patient (2,0) will be infected by patient (1,0). Patient (1,0) was infected in the first round. Only one patient is infected in the second round. Total amount of time taken for the whole area to be infected is 2. What is the algorthm can we use?
@Um3n14
@Um3n14 2 жыл бұрын
it is M*N miss can you help me with this problem?
@Idukhan-jj9kc
@Idukhan-jj9kc 2 жыл бұрын
💯💯
@mdalishanali3909
@mdalishanali3909 2 жыл бұрын
great same name just n is not there
@meandpenguinvlogs8221
@meandpenguinvlogs8221 2 жыл бұрын
Udeserb more and more subscribers 👍👍
@ayushtiwari3819
@ayushtiwari3819 Жыл бұрын
very sloppy presentation to be honest. You take it slow, write down things properly. I get the gist but still.
Subsets - Backtracking - Leetcode 78
8:47
NeetCode
Рет қаралды 297 М.
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 97 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 14 МЛН
路飞做的坏事被拆穿了 #路飞#海贼王
00:41
路飞与唐舞桐
Рет қаралды 25 МЛН
L4. Power Set | Bit Manipulation
12:38
take U forward
Рет қаралды 72 М.
I Solved 1583 Leetcode Questions  Here's What I Learned
20:37
ThePrimeTime
Рет қаралды 754 М.
Print Subsets | Print PowerSets | Print all Subsequences
15:48
Aditya Verma
Рет қаралды 195 М.
Subsets - Leetcode 78 - Recursive Backtracking (Python)
11:51
Greg Hogg
Рет қаралды 11 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 269 М.
Power Set | Print all Subsequences
9:56
take U forward
Рет қаралды 174 М.