Lecture 10: Solving LeetCode/CodeStudio Questions [Arrays]

  Рет қаралды 1,436,859

CodeHelp - by Babbar

CodeHelp - by Babbar

Күн бұрын

Пікірлер: 2 500
@preetkatiyar969
@preetkatiyar969 3 жыл бұрын
If we get such teachers and such good explanation then no power in the world will stop me from going to product based company. Love u babbar sir and Thank u so so much.
@om-prakash-yadav
@om-prakash-yadav 2 жыл бұрын
jab job mil jaye to yahan reply kar dena... i am waiting ..
@preetkatiyar969
@preetkatiyar969 2 жыл бұрын
@@om-prakash-yadav kyu tu meri company me safai karmchari ki naukri karega kya
@kumargaurav9116
@kumargaurav9116 2 жыл бұрын
@@preetkatiyar969 Professionalism 100%.
@niteshsaxena3210
@niteshsaxena3210 2 жыл бұрын
well its not 100% true, this video is watched by over 250k people and I don't think so that even 1% of this number will get into FAANG as seats are limited, you should target startups also along with PBC
@preetkatiyar969
@preetkatiyar969 2 жыл бұрын
@@niteshsaxena3210 Why people Like you just spreading negativity , If you you don,t deserve or you are not able to grab oportunity or you can,t do it thats your falt so instead of doing this nonsense just say anyone can just because now days everyone is doing hardwork and giving his/her lots of efforts. You don,t know how these product Jobs are important for that person who is preparing day-night. SO PLEASE SHUT YOUR MOUTH. AND LET THEM CRACK EVERY COMPANY.
@RandomIndianStuff
@RandomIndianStuff Жыл бұрын
This video lecture series is seriously helping me to recollect my lost grounds once again. Can't thank you enough Love for these outstanding lectures. 🥺
@najafalibalti
@najafalibalti Жыл бұрын
I hope this message finds you well. I wanted to reach out and share my current learning journey in Data Structures and Algorithms (DSA). I've been dedicating time to learn from KZbin tutorials, but I'm facing challenges in tackling array duplication and occurrence questions.
@newhope5729
@newhope5729 Жыл бұрын
Brothers I wish to ask whether code studios support CPP STL or not because l have never been able to use it on Codestudios
@govindsuryavanshi6653
@govindsuryavanshi6653 Жыл бұрын
First I have completed all DSA series and now conclude this is Greatest ever DSA series to exist on youtube or paid courses. Your contribution will be remembered. You're God of DSA for us🙇‍♂
@umang_29
@umang_29 Жыл бұрын
bro do u have hand written notes?
@codingriovo631
@codingriovo631 Жыл бұрын
yes bro@@umang_29
@komalnagori280
@komalnagori280 Жыл бұрын
I don't usually do comments.. but for this playlist.. I couldn't stop myself.. the best playlist I can found is your... I tried multiple playlist for learning c++ and dsa but couldn't find the one who can teach as good as you do.. thank you so much bhaiya..
@narutodihargo
@narutodihargo Жыл бұрын
00:00 - Introduction 01:28 - Ques1 - Swap Alternates 02:49 - Promotion 03:53 - Example 07:03 - Implementation 10:58 - Dry Run again 13:23 - Swap Function breakdown 16:43 - Ques2 - Find Unique element 25:03 - Implementation 26:55 - LeetCode Homework 30:46 - Ques3 - Find Duplicates 36:21 - Implementation 38:38 - Homework 40:51 - Ques4 - Array Intersection 46:22 - Implementation 50:51 - Got TLE 51:18 - Optimisation 1 54:40 - Optimisation 2 01:01:28 - Ques5 - Pair Sum 01:03:43 - Implementation 01:10:06 - Dry Run 01:11:27 - Ques6 - Find triplets with given sum 01:14:53 - Ques7 - Sort 0 1 01:21:20 - implementation 01:33:23 - Homework
@rameshwari
@rameshwari 3 жыл бұрын
You're killing it🌟🌟 Keep posting till the end of the series.
@MrFaraziOfficial
@MrFaraziOfficial 2 жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@rajbharati8952
@rajbharati8952 Жыл бұрын
@@MrFaraziOfficial thank you for your notes
@maheshsharma9695
@maheshsharma9695 2 жыл бұрын
I am working professional in one of the MNC and following your DSA course. You are providing good content with depth explanation. Keep doing great work. Thanks
@jethalal4848
@jethalal4848 Күн бұрын
Hlo bro
@kunalprakash7826
@kunalprakash7826 Жыл бұрын
For swapping adjacent element I initialized i with 1. it help to remove if condition. for(int i = 1; i < size; i = i+2){ swap(arr[i], arr[i-1]); }
@rupeshkarki6145
@rupeshkarki6145 Жыл бұрын
nice
@robinofautumn99
@robinofautumn99 Жыл бұрын
31:00 homework--> duplicates in an array int findDuplicate(vector &arr) { int m[arr.size()]={}; for(int i=0; i1) return arr[i]; } } O(n)--> time complexity O(n)--> space complexity
@manishbulchandani8306
@manishbulchandani8306 Жыл бұрын
a better approach to solve at 38:10 is // Write your code here int N=arr.size(); int sum=0; for(int i=0;i
@AmanSingh-cc2ci
@AmanSingh-cc2ci Жыл бұрын
Nhi chla bhai Tera bhi code🥴
@rahul_kumar_bhagat
@rahul_kumar_bhagat Жыл бұрын
@@AmanSingh-cc2ci yaha n-1 ke jagh pe n+1 laga ke dekho
@animeshsahoo-yo1tt
@animeshsahoo-yo1tt 4 ай бұрын
bruh formula to shi se laga de
@adityasinghrawat6664
@adityasinghrawat6664 3 ай бұрын
@@animeshsahoo-yo1tt bhai shi se hi lagaya he usne tune galat convey kr liya hai woh sum of array se sum of n-1 kr rha hai jisse extra number mil jaye aur sum of n-1 " n-1)*n)/2" hoga
@adityasinghrawat6664
@adityasinghrawat6664 3 ай бұрын
@@AmanSingh-cc2ci bhai chlra hai uska code
@ritomukherjee8389
@ritomukherjee8389 2 жыл бұрын
26:18 (Brute force approach ): int findUnique(int *arr, int size) { //Write your code here for(int i = 0; i < size; i++) { int count = 0; for(int j = 0; j < size; j++) { if(arr[i] == arr[j]) { count++; } } if(count == 1) { return arr[i]; } } return -1; }
@lokeshmethani2656
@lokeshmethani2656 2 жыл бұрын
Bhai i or j kese zero se start kr skte ho glt h code
@shivprasadshinde2577
@shivprasadshinde2577 2 жыл бұрын
@@lokeshmethani2656 j ko I+1 se initial Krna hoga na bhai
@mr_pm_arena
@mr_pm_arena 7 ай бұрын
​@@shivprasadshinde2577bro tumne agar count =0 pakda hai toh j+1 nahi Kiya toh bhi chalega n
@cuteminired6550
@cuteminired6550 7 ай бұрын
Thanks 😊
@praveenwandhekar911
@praveenwandhekar911 4 ай бұрын
​@@lokeshmethani2656 Kyu nahi ho sakta ho sakta hai na
@ayushkushwaha171
@ayushkushwaha171 3 жыл бұрын
For "Array Intersection" question, I was able to think of brute force (n^2) solution in my head alone & then I was able to find your optimised solution 2, without even watching that part in the video!! Really happy feeling that I am getting in there slowly because of these tutorials!! Thanks Bhaiya ❤️🎉🔥
@arjunyadav-kt5jr
@arjunyadav-kt5jr 2 жыл бұрын
what is your progress now
@itsmeakash_
@itsmeakash_ 2 жыл бұрын
Progress?
@MrFaraziOfficial
@MrFaraziOfficial 2 жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@truptichoudhary9466
@truptichoudhary9466 Жыл бұрын
@@MrFaraziOfficial Thanks So much your notes are very much helpfull for me
@aditibandewar1649
@aditibandewar1649 8 ай бұрын
​@@MrFaraziOfficial age ke notes kaha hai
@amankumbhalwar
@amankumbhalwar 3 жыл бұрын
जो कठिनाईयों से सीखता है, वही आसानी से समझा सकता है । जय श्री कृष्ण ❤🙇‍♂️🙏
@prasadcode58
@prasadcode58 2 жыл бұрын
I am now clearly understanding about arrays, even I also learned about vectors and its methods, thanks guruji!!! ❤
@MrFaraziOfficial
@MrFaraziOfficial 2 жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@GauravSingh-e5e1p
@GauravSingh-e5e1p Жыл бұрын
@@MrFaraziOfficial hey can you provide me link of complete dsa course by love babbar
@najafalibalti
@najafalibalti Жыл бұрын
I hope this message finds you well. I wanted to reach out and share my current learning journey in Data Structures and Algorithms (DSA). I've been dedicating time to learn from KZbin tutorials, but I'm facing challenges in tackling array duplication and occurrence questions.
@funlearning5989
@funlearning5989 10 ай бұрын
video completed.... consistency is power...lets see the magic
@raghavsinghal22
@raghavsinghal22 3 жыл бұрын
I don't understand the problem of a unique number of occurrences because all are using maps and all.
@SaurabhKumar-ck7yb
@SaurabhKumar-ck7yb 2 жыл бұрын
#include using namespace std; bool myfunc(int a[]){ for(int i = 1; i
@kanikagupta2806
@kanikagupta2806 2 жыл бұрын
@@SaurabhKumar-ck7yb ty for this
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/qnK0en6bZbp6fpY
@ronitsingh5926
@ronitsingh5926 2 жыл бұрын
Bhai ye O(n) me kaha hoo raha h ?
@amarjeetyadav26436
@amarjeetyadav26436 2 жыл бұрын
@@SaurabhKumar-ck7yb ye kya hua
@ritomukherjee8389
@ritomukherjee8389 2 жыл бұрын
1:33:57 (3 pointer solution with O(n) Time complexity ): #include void sort012(int *arr, int n) { // Write your code here int i = 0; int mid = 0; int k = n - 1; while ( mid
@avinash__02_
@avinash__02_ 2 жыл бұрын
is mid =n/2 ?
@priyanshumahukhaye6282
@priyanshumahukhaye6282 2 жыл бұрын
@@avinash__02_ no
@vineetgupta6813
@vineetgupta6813 2 жыл бұрын
what is mid and how you assigned it? is it a value or have you given starting index(0) two different name one is i and the other one is mid??
@ameykinjalkar1424
@ameykinjalkar1424 Жыл бұрын
@@vineetgupta6813 hey, he has taken "mid" as in "j" and it has the starting index of 0 just like "i" and basically we're checking when this pointer in the array comes across "0", "1" or "2" then different cases are getting executed. Like if we found 0, swap it with the left most pointer "i" (since the order of the sort is 0..,1..,2..) then increment "i" and "j". Then if we found 1, let it be at it's place and increment j and if we found 2, then swap it with the right most pointer "k" and decrement k. This way we're sending all 0's to the left most end, keeping the 1's in the middle and sending all 2's to the right most end. Hope this helps :)
@Master-sy8si
@Master-sy8si 2 жыл бұрын
Bro, thanks for the video!! It's great that you haven't deleted/cut the video parts where you have made mistakes in the logic. Due to this we are also learning "how to debug our code". It's really helpful man! Thanks a lot Love!!
@ashishpandey2002
@ashishpandey2002 Жыл бұрын
Aapki videos bohot simple and straight forward hoti hai aapka language ekdum synchronized feel hota hai at the end maza ata hai🙏🙏♥♥
@parthagarwal3522
@parthagarwal3522 8 ай бұрын
Thanks bhaiya. I am starting coding at my 3rd year's end and I cannot tell you how grateful I am that I have this playlist.
@cuteanime2
@cuteanime2 3 жыл бұрын
bhaiya, one of the best video i've ever seen on array questions. and the way you solve the problems using different approaches is next level. you are the best. and thank you so much for such a helpfull series.
@vitragrathi6522
@vitragrathi6522 2 жыл бұрын
duplicte element:- int findDuplicate(vector &arr) { // Write your code here int n=arr.size(); int sum1=0; int sum2=0; for(int i=0;i
@sagarbgmi5337
@sagarbgmi5337 2 жыл бұрын
nice buddy
@kartikkothekar6862
@kartikkothekar6862 3 ай бұрын
☠💀
@ritikagrover2724
@ritikagrover2724 2 жыл бұрын
01:14:53 - Ques7 - Sort 0 1 🔸void sort_01(int arr[], int n) { int i = 0, j = n - 1; while(i
@YugiPlayz
@YugiPlayz Жыл бұрын
Sahi... andar loop lagane ka zarurat nahi hai!
@travelvlogs1972
@travelvlogs1972 4 ай бұрын
@@YugiPlayzi also thought why loop inside while , we can check it with if else
@AMITSHARMA-zt4ee
@AMITSHARMA-zt4ee 9 ай бұрын
Great . itna acha content free me
@najafalibalti
@najafalibalti Жыл бұрын
I Finally complete this video in around 4 to 5 complete day. just because i am using c to acheive my result. But this teacher is really Great Appreciated ! ❣❣ Love From Pakistan
@yashendrabadal4776
@yashendrabadal4776 Жыл бұрын
use c++ bro
@ahmadrasheed2598
@ahmadrasheed2598 3 ай бұрын
Current Progress (also from Pakistan)
@ankitkeshri9153
@ankitkeshri9153 2 жыл бұрын
This is the best course I have ever seen. I appreciate your hard work Bhaiyaa. ❤
@dikshajain9845
@dikshajain9845 3 жыл бұрын
Homework: 1. Unique Number of Occurrences bool uniqueOccurrences(vector& arr) { int n = arr.size(); unordered_map m; for(int i=0;i
@deepak_chourasiya2110
@deepak_chourasiya2110 2 жыл бұрын
Help me plz
@sowtheshv9904
@sowtheshv9904 Жыл бұрын
sort function in finding duplicates uses time complexity of nlogn
@hardikparmar4180
@hardikparmar4180 Жыл бұрын
pr bhai ye sab concept to abhi tak sikhaye hi nay
@AtharvGupta098
@AtharvGupta098 11 ай бұрын
@@hardikparmar4180 exactly, koi simplier solution mila?
@hardikparmar4180
@hardikparmar4180 11 ай бұрын
@@AtharvGupta098 nope
@k.pavansai3056
@k.pavansai3056 3 жыл бұрын
Please Explain Hash Maps. This is being used to solve many questions including The LeetCode's Find unique occurrences
@kishanprajapati6927
@kishanprajapati6927 2 жыл бұрын
yes bro did find the solution of unique occurence question without using hash map if you please can you submit that in discord 7-10 lec server .
@kishanprajapati6927
@kishanprajapati6927 2 жыл бұрын
yes bro did find the solution of unique occurence question without using hash map if you please can you submit that in discord 7-10 lec server .
@rameshmalhotra9525
@rameshmalhotra9525 2 жыл бұрын
kzbin.info/www/bejne/jpPEcmRjd65gsNk
@piyushsinha9989
@piyushsinha9989 2 жыл бұрын
duplicates in an array {1,2,3,4,.....x..........N-1, x} how 2nd x came after N-1 if N-1 is the last element of the array
@Rutik9999
@Rutik9999 2 жыл бұрын
@@piyushsinha9989 he is not talking about index, he is just explaining in terms of values
@Op-fire-qq8xl
@Op-fire-qq8xl 6 ай бұрын
Swap alternate start=0; end=1; While(end
@mkrstudypoint6481
@mkrstudypoint6481 26 күн бұрын
this condition is working fine for even number of elements but not for odd ones
@akshitamishra18
@akshitamishra18 10 ай бұрын
bhaiyaa abhi tak ka phla video arrays ka jo samajh ayyaaa.....Thankyou so much
@prkilmmm
@prkilmmm 3 ай бұрын
love you
@jawhoralikhan2541
@jawhoralikhan2541 3 жыл бұрын
Bhaiya aise hi darshate rahiye❤❤❤
@abhishekverma1528
@abhishekverma1528 3 жыл бұрын
Bhaiya "we are ready for continuous lecture" bas 3-4 month me khatm kara do with quality content . Jai hind. Dhanywaad bhrata shree 💙
@shubhamjangle7633
@shubhamjangle7633 3 жыл бұрын
Only Two words - "QUALITY CONTENT"🤩🤩
@ShiwanaGhai
@ShiwanaGhai 7 ай бұрын
I love that you explain everything two times atleast. Thank you!
@mdwaqar7401
@mdwaqar7401 Жыл бұрын
Finally After 4 Days of Watching and Understanding this video and doing the Problems by myself I completed this Video. I understood a Great Deal. Also the Last Problem that you showed with 2 While Loops Sorting 0's and 1's Sorting Problem. I did it with just one While Loop and it works. int i = 0; int j = size-1; while (i
@newhope5729
@newhope5729 Жыл бұрын
bhai ye maine code likha 30:43 par question Find duplicates ka: int findDuplicate(vector &arr) { set s; for(auto i:arr) { if(s.count(arr[i])==1) return arr[i]; else s.insert(arr[i]); } // Write your code here } par ye error de rha Codestudio : Compilation Failed In file included from runner.cpp:9:0: solution.h: In function 'int findDuplicate(std::vector&)': solution.h:3:5: error: 'set' was not declared in this scope set s; ^ solution.h:3:9: error: expected primary-expression before 'int' set s; ^ solution.h:6:12: error: 's' was not declared in this scope if(s.count(arr[i])==1) ^ Bhai merko aap bta sakte hain ki kya ye codestudio stl functions accept nahi karta kya?? Because is se pahle "Find Unique" waale question me bhi binary_search function ko problem bataa rha tha....... Please help I request you bhaiya ji 🙏🙏🙏🙏 I'll be very grateful 🙏🙏🙏🙏
@shahtanmay902
@shahtanmay902 2 жыл бұрын
The sorting algorithms for sort 0,1,2 is called the DNF(Dutch national flag) sort, where we user three pointers and solve the problem in O(n).
@parth6661
@parth6661 Жыл бұрын
bro in this question why we are unable to use sort(arr.begin(), arr.end());
@adityanarayan5641
@adityanarayan5641 Жыл бұрын
@@parth6661because it is an array, but we can do this sort for vectors.
@parth6661
@parth6661 Жыл бұрын
@@adityanarayan5641 ohkk thanks bro
@AbhinavVeeramalla
@AbhinavVeeramalla Жыл бұрын
bhaiya it would be helpful if you could provide answers to homework questions because the answers that are in internet seems to be not optimized and doesn't relate to the context you are setting like in that question to find unique number of ocurences there is only brute force solution in arays and solution with hash map. there is no solution as which you have to said it can be optimized. can you please add solutions from your side too. it would be quite helpful
@AnkurWrites
@AnkurWrites 3 ай бұрын
Yeah exactly.
@ALOKKUMAR-qj2bw
@ALOKKUMAR-qj2bw 3 жыл бұрын
Watched till end and after 2 month I am solving this much question and proper set of question( level wise problem). All because of you #Lovebabbar ☝️☝️🙏
@saurabhfreefire2205
@saurabhfreefire2205 2 жыл бұрын
Can I Connect With You
@khatariinsaan5284
@khatariinsaan5284 Жыл бұрын
@ROCKSTAR GAMES VI Can I connect with you...
@Kumar04111
@Kumar04111 Жыл бұрын
@@khatariinsaan5284 Can I connect with you....
@newhope5729
@newhope5729 Жыл бұрын
@@Kumar04111 Can I connect with you.....
@itzmranonymous
@itzmranonymous Жыл бұрын
@@Kumar04111 Can I connect with you.....
@chinmayeemohapatra9233
@chinmayeemohapatra9233 2 жыл бұрын
mazaa aaraha hai question solve krne me... 10 baby steps ✅... More ahead to complete🔥
@motivation_with_harsh
@motivation_with_harsh 8 ай бұрын
Unique Occurance of Element in the Array class Solution { public: bool uniqueOccurrences(vector& arr) { unordered_map m; for(int i = 0 ; i < arr.size() ; i++){ m[arr[i]]++; } unordered_set s; for(auto pair : m){ s.insert(pair.second); } return m.size() == s.size(); } };
@soham_mondal
@soham_mondal 2 жыл бұрын
23:10 How the xor operator works? Specially with integers 26:55 39:38 How to do it? 1:33:33
@hum__shyam
@hum__shyam 2 жыл бұрын
Bro watch previous video!
@AayushGoyal
@AayushGoyal 2 жыл бұрын
For swapping alternate elements: void swapAlt(int arr[], int size){ int a=0,b=1; while(b
@deepakkansal9112
@deepakkansal9112 Жыл бұрын
mne b ese hi try kiya
@rishabjha2003
@rishabjha2003 Жыл бұрын
At 1: 11 08 pr loop n-1 tak kyu chal rha hai sir
@Ashutoshkumar-qf4ne
@Ashutoshkumar-qf4ne 3 жыл бұрын
This course really help me to understand the concepts very well. Thank you so much LOVE BABBAR Sir.
@YashSaxena1-s6l
@YashSaxena1-s6l 10 ай бұрын
Aaaj se bhaiya dsa firsse shuru aur wo b consistency maintain karuga Thankyou love bhaiya for the amazing lectures Lots of love to the love sir ❤🙏
@bernardhackwell4410
@bernardhackwell4410 2 жыл бұрын
1:31:34 Bhaiya the reason we were facing this issue was because we used while loops (which were used for incrementing left and right side ) inside the whlie loop (which was checking the condition of left < right ). Instead we could've used if-else for incrementing and decrementing left and right which would've solved the problem of righting ( && left
@HKClasher
@HKClasher 2 жыл бұрын
Yes correct, jaisa bhaiya ne kiya hai usse toh complexity jada he ho gyi hai no need of while loop inside while, if-else and 2 pointers approach is best in this case.
@aryanmalik919
@aryanmalik919 2 жыл бұрын
@@HKClasher exactly that is what i was thinking why he used loops when if else can be used instead
@garvgupta4219
@garvgupta4219 Жыл бұрын
Sir homework problems bina brute force ke solve nahi ho rahe and leetcode ke discussion forum main aage ke concepts se solve kar rakhe hain problems, how to find the solutions of these problems?
@MohdSaifEC
@MohdSaifEC 11 ай бұрын
Maine XOR karke kara tha question toh 54/69 testcases pass hue submit he ni ho rha h...
@pratyakshdixit7576
@pratyakshdixit7576 9 ай бұрын
@@MohdSaifEC Solution bhej sakte ho bhai
@MohdSaifEC
@MohdSaifEC 9 ай бұрын
@@pratyakshdixit7576 bro dhundna pdega yaar...
@brayansaldanha8358
@brayansaldanha8358 2 жыл бұрын
In the sorting 0,1 question , we don't need two while loops. I think this is a better optimized solution : void sort_01(int a[] , int n){ int low = 0; int high = n-1; while(low
@satvikchauhan85
@satvikchauhan85 Жыл бұрын
Just one thing I noticed At 50:51 When we got TLE for firs time the runtime is 4944ms and after putting only one condition at 53:29 [ele
@_Itachiii
@_Itachiii Жыл бұрын
to swap alternate elements in an array we can use a single loop for both even and odd sized arrays i thought this logic and it works very well for(int j=0; j
@devanshuu
@devanshuu Жыл бұрын
it wont work for even sized arrays
@_Itachiii
@_Itachiii Жыл бұрын
@@devanshuu it is working
@mmujtabah
@mmujtabah 3 ай бұрын
@@devanshuu it works for both even & odd
@sumitkumbhkarn
@sumitkumbhkarn Жыл бұрын
solution at 37:42 doesn't work for test cases like [2,2,2,2,2]
@sparshgamer1582
@sparshgamer1582 3 ай бұрын
Pls give solution for this test case
@vikasyadav-vq2fu
@vikasyadav-vq2fu 2 жыл бұрын
Thank you so much Babbar bhaiya !! For providing your precious knowledge here, so glad to learn this.
@changed217
@changed217 Жыл бұрын
Quite tough of a lecture, for me at least, thank you for teaching with such patience.
@fuasteriskk
@fuasteriskk Жыл бұрын
it was damn tough didn't understand much
@newhope5729
@newhope5729 Жыл бұрын
Brothers I wish to ask whether code studios support CPP STL or not because l have never been able to use it on Codestudios
@saadtariq1199
@saadtariq1199 Жыл бұрын
yaar damn tough this lecture was..
@primeop8576
@primeop8576 Жыл бұрын
@@newhope5729 just include the library stdc bro it will work
@VishalKumar-lk1pt
@VishalKumar-lk1pt 11 ай бұрын
Quite😢
@Shakti_singh96
@Shakti_singh96 6 ай бұрын
00:05 The video covers topics on accessing addresses, creating and slicing, and the impact of function updates. 02:55 The video discusses a digital platform for courses and the availability of various subjects. 07:51 Understanding and debugging array manipulation in the function 10:40 Understanding array manipulation and numerical operations 16:18 Understanding how to handle a specific type of list number. 18:37 Identifying the number which appears only once in a given array. 22:46 Combining elements results in specific outcomes 26:19 Solving LeetCode/CodeStudio Questions using arrays. 31:13 Understanding the manipulation of numbers from one to end minus one in an array. 34:12 Summarizing algorithm for combining given numbers 40:13 Homework includes finding duplicates and understanding intersection concepts. 43:11 Using a closed loop to solve a simple logic problem. 48:23 Debugging and understanding code for LeetCode/CodeStudio array questions 50:39 Proposed solution for LeetCode/CodeStudio arrays problem is not optimized 54:47 Using and making sense of Bluetooth 233 58:25 Understanding conditions and debugging code 1:04:46 Understanding and using the answer center in-charges. 1:08:18 Sorting a list of values in decreasing order based on their first value 1:15:11 Understanding optimization and solving LeetCode/CodeStudio questions with arrays 1:17:38 Solving LeetCode/CodeStudio Questions with Arrays 1:23:02 Discussion on various topics related to electronics and conditions. 1:25:56 Solving LeetCode/CodeStudio Array questions with detailed explanation 1:32:05 Understanding the approach of moving left 120 and the logic behind it 1:34:01 Understanding LeetCode/CodeStudio Questions
@siri_study
@siri_study Жыл бұрын
This video took me quite some time than the others to understand and complete all the homeworks but I learned loads. Thanku Babbar sir :)
@priyanshurathore8098
@priyanshurathore8098 Жыл бұрын
how did you solve first lead code problem??
@GOJOANDSUKUNAFAN
@GOJOANDSUKUNAFAN 9 ай бұрын
​@@priyanshurathore8098it's fucking easy 💀
@chitranshverma1822
@chitranshverma1822 9 ай бұрын
Bhaiya Leetcode ke homework questions toh bilkul bhi nai bn rahe ....pls guide,,.... discussion is soo difficult... somebody pls help
@pranavpatil4095
@pranavpatil4095 8 ай бұрын
bhai pehela HW question me to hash map use karna hai aab mujhe bas hash map kya hota hai kaise kam karta hai pata hai baki kaise use karna hai pata nahi to thoda confusion ho raha hai baki jo aab tak sikhaya hai use solution nahi ban raha hai HW wale question ka ;_;
@Maharashtra_Dharma
@Maharashtra_Dharma 2 жыл бұрын
sir please explain unique number of occurences. because maximum solutions in the discussion forums of leetcode are using Hashmap.
@delta_mohit
@delta_mohit Жыл бұрын
+1
@aadarshdubey5738
@aadarshdubey5738 Жыл бұрын
can you please share the code
@UPSC_IAS_IPS_007
@UPSC_IAS_IPS_007 2 жыл бұрын
this video take my 8 hour approx to complete it. thanks bhaiya for helping us
@sataesthetic
@sataesthetic 2 жыл бұрын
bhaiya maine aapki video puri dekhi or mujhe to bhot he maza aaya!
@ehtesamzunnuryn282
@ehtesamzunnuryn282 Жыл бұрын
why didn't u give us the solution of the first leetcode solution? it was quite tough for a very beginner (a beginner who already followed your previous videos on this playlist)
@hermionegranger6493
@hermionegranger6493 2 жыл бұрын
Enjoying this series!Amazing work!
@amarnathprajapati2543
@amarnathprajapati2543 2 жыл бұрын
Completed such a amazing session with honesty.
@ispetter6537
@ispetter6537 10 ай бұрын
Sorting of 0&1 can be done easily with replacing inside while loop with if else if, Customized 🎉🎉
@sumanjangid9306
@sumanjangid9306 Жыл бұрын
Solution of find all Duplicates in an array by hashmap class Solution { public: vector findDuplicates(vector& nums) { vector ans; int n = nums.size(); vector hash(n + 1, 0); // Initialize a hash array of size n+1 with all elements set to 0 for (int i = 0; i < n; i++) { hash[nums[i]]++; // Increment the count for the corresponding number in the hash array } for (int i = 1; i 1) { ans.push_back(i); // If the count is greater than 1, add the number to the result vector } } return ans; } };
@kankanaki4368
@kankanaki4368 2 жыл бұрын
you can also solve array interaction question: vector findArrayIntersection(vector &arr1, int n, vector &arr2, int m) { int i=0,j=0; vector ans; while(i
@no_1313
@no_1313 Жыл бұрын
@kushalshivhare4366 Do bar aye to do bar he hoga, unique element wise dekhna hai, ek pair dubara use nahi hoga
@itzmranonymous
@itzmranonymous Жыл бұрын
thanks i was doing a silly mistake as i am new to c++ and just now learnt about vector and your code solved it , i cant believe i was wasting so much time searching for error :( . Thanks a lot keep posting codes like this
@sounaksaha1455
@sounaksaha1455 3 жыл бұрын
2 days late, but still watched the whole video in one shot. Thanks bhaiya for providing such quality content. We are grateful to you.
@tomiokascuteness1909
@tomiokascuteness1909 2 жыл бұрын
(I traversed through array and compared each element with the others and checked if they are equal made them 0 and printed the non zero element) I know time complexity is going harsh but just another approach int findUnique(int *arr, int size) { //Write your code here for(int i=0;i
@shaktawatrinku141
@shaktawatrinku141 Жыл бұрын
thanks for this solution :)
@krato8731
@krato8731 Жыл бұрын
bhot bdia video thi bhaiya small correction at 1:31:00 use if instead of while then you wont need to write "& left
@adarshpandey2515
@adarshpandey2515 3 жыл бұрын
Intersection of arrays vector findArrayIntersection(vector &arr1, int n, vector &arr2, int m) { // Write your code here. vector ans; int i=0 ; int j=0; while(i
@nikhilrauniyar9084
@nikhilrauniyar9084 2 жыл бұрын
Alternate solution for SORT 0 1 2 (Probably the easiest to understand) #include void sort012(int *arr, int n) { // Write your code here int low = 0, mid = 0, high = n-1; while(mid
@MDImran-7861
@MDImran-7861 Жыл бұрын
Yes this the easiest and fastest method thanks brother
@fouzan.f9875
@fouzan.f9875 Жыл бұрын
thanks bro
@prakharbansal4748
@prakharbansal4748 Жыл бұрын
TLE
@bhaveshs1745
@bhaveshs1745 3 жыл бұрын
Thank you so much for this series Bhai 🔥 Har video ke saath excitement badhte hi jaa rahi hai ab 💯
@visheshkaran7083
@visheshkaran7083 3 жыл бұрын
True
@mahigour7124
@mahigour7124 Жыл бұрын
Swap alternate different method:- for (int i = 0; i < size-1; i+=2) { swap(arr[i],arr[i+1]); }
@GaneshKumatole
@GaneshKumatole Жыл бұрын
1:00:00 loved this one ... 🔥🔥🔥♥️♥️♥️👍👍👍 Thank you Bhaiya .
@aryanisgood
@aryanisgood 5 ай бұрын
39:25 we can also do this question by adding all numbers from 1 to N-1 and then subtracting it with sum of array, it will give us the repeating number
@awais_ansarii
@awais_ansarii 2 жыл бұрын
Such a Great Session Sir❣️ Enjoying watching the entire playlist... Huge Respect ❣️
@MrFaraziOfficial
@MrFaraziOfficial 2 жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@balbirMs
@balbirMs 3 жыл бұрын
Very short Solution: sort 0 1 2 #include #include void sort012(int *arr, int n) { // Write your code here vector a(arr+0,arr+n); sort(a.begin(),a.end()); for(int i=0;i
@chiragkukreja_ds.b.g1_286
@chiragkukreja_ds.b.g1_286 2 жыл бұрын
.
@a092devs
@a092devs 2 жыл бұрын
Can you explain this? a(arr+0,arr+n);
@leenapatil6972
@leenapatil6972 2 жыл бұрын
Hey.. can you explain?
@parthsatvekar5411
@parthsatvekar5411 Жыл бұрын
literally one of the best coding teacher on yt
@Vedo-e5b
@Vedo-e5b 8 ай бұрын
Isse dekhne mei 3 din lgg gyaa .may be thoode new concept aur questions thee iss liye but now its time to buckle up
@sakshibhokare5630
@sakshibhokare5630 3 жыл бұрын
You are fantastic bhaiya💖 I got my interest in coding just because of you!!! thank you so much 😊
@anikettripathi9238
@anikettripathi9238 2 жыл бұрын
Leetcode wala problem that u gave as homework, can it be done without using maps and hashing. but I haven't studied that part and I'm finding it hard to code using arrays only....... I'll be thankful to anyone who can refer a solution video or article that is understandable.
@itsengineer3263
@itsengineer3263 2 жыл бұрын
class Solution { public: bool uniqueOccurrences(vector& arr) { vector ans; int n = arr.size(); int x[n]; for(int i =0;i=0;z--) { if(arr[i]==arr[z]) { check++; break; } } if(check!=0) { continue; } int count=1; for(int j=i+1;j
@debaroonniyogi7629
@debaroonniyogi7629 2 жыл бұрын
Hi, I too had the problem so I made the program with only arrays like you want. It's complexities are a bit high but without hashing, it can't be optimized further. Reply if you find it useful ! bool uniqueOccurrences(int* arr, int arrSize) { int i, j, arr1[arrSize], k; int n = arrSize, count=0; //Initializing the arr1 with -1 for(i=0; i
@sarveshkulkarni6287
@sarveshkulkarni6287 2 жыл бұрын
@@debaroonniyogi7629 class Solution { public: bool uniqueOccurrences(vector& arr) { int ct[1000]={0}; int n=arr.size(); for(int i=0;i
@debaroonniyogi7629
@debaroonniyogi7629 2 жыл бұрын
@@niteshsaxena03 leetcode will not pass it. The test cases there will not be satisfied unless you use hashing. I gave this without hashing. You can try in your own local compiler and check out
@adityasinghrawat6664
@adityasinghrawat6664 3 ай бұрын
@@debaroonniyogi7629 thanks bro for sharing this solution i have learned many new things out of it this helpwd me a lot
@ananwitasarkar9331
@ananwitasarkar9331 3 жыл бұрын
@CodeHelp - by Babbar bhaiya please... h/w problems ke ek solution sheet attach kar dijiyega at the end of the video... Or Atleast, kese uss problem ko approach kare...( i mean your kinda optimised approach 🥺🥺) It will be very helpful. :-) As I always keep wondering whether my approach is the optimised one or if there is any other better approach that you have thought of....
@mohitdodeja6688
@mohitdodeja6688 2 жыл бұрын
Hey do you have your approach as I'm really stuck at h/w questions for nearly day.. if possible please do help.
@mdfarhanali305
@mdfarhanali305 2 жыл бұрын
@@mohitdodeja6688 I also got stuck in homework questions
@mohitdodeja6688
@mohitdodeja6688 2 жыл бұрын
@@mdfarhanali305 Hey go to discord there are some really good people they would help you with the problem...to go number (the lec number you are on) channel and post your doubt you will get your answers
@adityasinghdangi6908
@adityasinghdangi6908 5 ай бұрын
Solution of Find all duplicates in an array using a different approach - class Solution { public: vector findDuplicates(vector& nums) { int size = nums.size(); vector ans; sort(nums.begin(),nums.end()); int i=0; while(i
@narutoYT19
@narutoYT19 2 ай бұрын
bool find(int arr[] , int size){ for(int i =1 ; i
@Nitin_Kumar_Singh
@Nitin_Kumar_Singh 4 ай бұрын
26:55 bhaiya ye question nhi solve ho raha hai aur discussion me hashmap ka solutions hai
@AarrtiManocha
@AarrtiManocha 3 ай бұрын
bhai hua solve ??
@harshitchaubey8274
@harshitchaubey8274 3 жыл бұрын
Bahut sahi Bhaiya maza aaya🔥 Bus coding part samajne me thodi mushkil ho rahi he.... Algo you are teaching awesome Please focus more on code explaination 🙏 How code is working
@khemchand6431
@khemchand6431 2 жыл бұрын
we are living in a good area as we can consume these kind of content free of cost without giving a single ruppee thank you so much babbar bhiaya huge respect to you
@amaanahmad1693
@amaanahmad1693 2 жыл бұрын
era*
@kankanaki4368
@kankanaki4368 Жыл бұрын
you are giving money for internet
@anuradha3868
@anuradha3868 2 жыл бұрын
Sir to be very honest....i don't know why while watching ur vdos I got big smile on my face even my parents asks what happens to uh 🤭🤭 , just love ur way of teaching...keep going sir ☺️✨
@AdityaRaj-lj5wf
@AdityaRaj-lj5wf 2 жыл бұрын
@sarthakgupta1321
@sarthakgupta1321 Жыл бұрын
int findDuplicate(vector &arr) { int sum=0; int newSum =0; for(int i=0;i
@munnakrish3572
@munnakrish3572 3 жыл бұрын
sort 0 1 2 //Solved in two pass manner.Although I think it runs in linear time. //The main idea is to swap the positions of 0 and 2 in correct order!!. void sort012(int *arr, int n) { // Write your code here int firstValue = 0; int thirdValue = 2; int firstIdx = 0; for(int i = 0; i < n;i++){ if(arr[i] == firstValue){ swap(arr[i],arr[firstIdx]); firstIdx++; } } int thirdIdx = n - 1; for(int i = n - 1; i >= 0;i--){ if(arr[i] == thirdValue){ swap(arr[i],arr[thirdIdx]); thirdIdx--; } } }
@sambhavsharma2780
@sambhavsharma2780 2 жыл бұрын
Nice Approach bro 👌
@shubh-kr
@shubh-kr 2 жыл бұрын
26:55 I'm wondering if there's any way to implement bit logic in the solution. Be it the counting approach or the hashmap. Somehow, if we can relate the implementation (25:03) of the Codestudio's "find unique" problem with the Leetcode#1207's implementation.
@kshitizsharma4461
@kshitizsharma4461 Жыл бұрын
hey i can't even solve this problem T_T
@shubh-kr
@shubh-kr Жыл бұрын
@@kshitizsharma4461 now that you're here, I'm sure you'll.
@siddhant2943
@siddhant2943 Жыл бұрын
For loop approach to swap alternate elements of an array(works for both odd and even size arrays) for(int i=0; i+1
@movieBOY2003
@movieBOY2003 Жыл бұрын
thanks bhai
@mmujtabah
@mmujtabah 3 ай бұрын
what about this solution isn't this more optimal since we are iterating to less than 1 size for (int i = 0; i < size - 1; i+=2) { swap(arr[i], arr[i + 1]); }
@juniorgaming5874
@juniorgaming5874 2 жыл бұрын
alternate solution of pair sum - in pair sum problem if you sort the input vector "arr" you didn't have to do the min and max part vectorans; sort(arr.begin(),arr.end()); for(int i=0;i
@Ultrabee1802
@Ultrabee1802 2 ай бұрын
Homework Solutions: 1. Unique number of Occurences: class Solution { public: bool uniqueOccurrences(vector& arr) { int n = arr.size(); vector count (2001, 0); for(int i = 0; i < n; i++) { count[arr[i] + 1000]++; } sort(count.begin(), count.end()); int i = 0; while(count[i] == 0) { i++; } for(int k = i; k < 2000; k++) { if(count[k] == count[k + 1]) { return false; } } return true; } }; 2. Find all duplicates in an array: class Solution { public: vector findDuplicates(vector& nums) { vector ans; for(int i = 0; i < nums.size(); i++) { while(nums[i] != nums[nums[i] - 1]) { swap(nums[i], nums[nums[i] - 1]); } } for(int i = 0; i < nums.size(); i++) { if(nums[i] != i + 1) { ans.push_back(nums[i]); } } return ans; } };
@apoorvasunkad6686
@apoorvasunkad6686 3 жыл бұрын
These videos are really helpful 👍🤗 Thank you for the Course 😀
@033_rajatsingh2
@033_rajatsingh2 Жыл бұрын
Most of the questions are based on vectors so should id do these questions after learning the STL for better understanding?
@onkarlapate27
@onkarlapate27 3 жыл бұрын
Thanks for giving homework questions on leetcode!!
@mehaksharma9391
@mehaksharma9391 2 жыл бұрын
did uh find the soln of unique occurence ques...without hasmaps
@rehanhussan
@rehanhussan 2 жыл бұрын
Complete Video maine Dekh liya bhoot Maza aaya
@MehakMalhotra-bj2ce
@MehakMalhotra-bj2ce 7 ай бұрын
leetcode homework question at 27:15 Unique Number of Occurences class Solution { public: bool uniqueOccurrences(vector& arr) { sort(arr.begin(), arr.end()); vector count; int num= 1; int s= arr.size(); for(int i=0; i
@amigoplayz3099
@amigoplayz3099 7 ай бұрын
thanks brother. helped a lot. solved my 1st problem.
@tusharrathore2610
@tusharrathore2610 2 жыл бұрын
Unique Number of Occurrences : Solution(Using only Arrays): sort(arr.begin(),arr.end()); vector v; int num = 0; for (int i = 0; i
@YogeshBora07
@YogeshBora07 Жыл бұрын
do i need to learn STL for these questions ?
@I_Anupam_Pandey
@I_Anupam_Pandey 3 жыл бұрын
37:43 Can anyone explain me why in 2nd for loop ans=ans^i instead of ans=ans^arr[i]; ?
@shoumickbardhan1460
@shoumickbardhan1460 2 жыл бұрын
we are zorring all the elements from 1 to n-1, as given that the elements will be from 1 - n-1. where n is the size.
@surendrajat7290
@surendrajat7290 2 жыл бұрын
i can't express my self , thank you for such videos sir .
Lecture 11:Time & Space Complexity || How to avoid Time Limit Exceeded [TLE]
29:12
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 799 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
VIP ACCESS
00:47
Natan por Aí
Рет қаралды 30 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
How to Start LeetCode from ZERO in 2025
11:31
Ashish Pratap Singh
Рет қаралды 108 М.
Lecture 12: Binary Search Explained in 1 Video [Theory + Code]
38:41
CodeHelp - by Babbar
Рет қаралды 912 М.
Trump's Plan for "Greater America" Explained
8:42
TLDR News Global
Рет қаралды 697 М.
Simon Sinek's Advice Will Leave You SPEECHLESS 2.0 (MUST WATCH)
20:43
Alpha Leaders
Рет қаралды 2,6 МЛН
Как наука победила религию
17:02
Nvidia CEO Huang New Chips, AI, Musk, Meeting Trump
15:28
Bloomberg Technology
Рет қаралды 199 М.
5 Secrets to Stop Stuttering & Speak More Clearly!
12:44
Vinh Giang
Рет қаралды 87 М.
Pick these tech to make or destroy your tech career
15:52
Chai aur Code
Рет қаралды 156 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.