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-yadav2 жыл бұрын
jab job mil jaye to yahan reply kar dena... i am waiting ..
@preetkatiyar9692 жыл бұрын
@@om-prakash-yadav kyu tu meri company me safai karmchari ki naukri karega kya
@kumargaurav91162 жыл бұрын
@@preetkatiyar969 Professionalism 100%.
@niteshsaxena32102 жыл бұрын
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
@preetkatiyar9692 жыл бұрын
@@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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
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_2911 ай бұрын
bro do u have hand written notes?
@codingriovo63110 ай бұрын
yes bro@@umang_29
@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 Жыл бұрын
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
@rameshwari2 жыл бұрын
You're killing it🌟🌟 Keep posting till the end of the series.
@MrFaraziOfficial Жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@rajbharati8952 Жыл бұрын
@@MrFaraziOfficial thank you for your notes
@maheshsharma96952 жыл бұрын
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
@ritomukherjee83892 жыл бұрын
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; }
@lokeshmethani26562 жыл бұрын
Bhai i or j kese zero se start kr skte ho glt h code
@shivprasadshinde25772 жыл бұрын
@@lokeshmethani2656 j ko I+1 se initial Krna hoga na bhai
@mr_pm_arena3 ай бұрын
@@shivprasadshinde2577bro tumne agar count =0 pakda hai toh j+1 nahi Kiya toh bhi chalega n
@cuteminired65503 ай бұрын
Thanks 😊
@praveenwandhekar91128 күн бұрын
@@lokeshmethani2656 Kyu nahi ho sakta ho sakta hai na
@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
@prasadcode58 Жыл бұрын
I am now clearly understanding about arrays, even I also learned about vectors and its methods, thanks guruji!!! ❤
@MrFaraziOfficial Жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@GauravSingh-e5e1p Жыл бұрын
@@MrFaraziOfficial hey can you provide me link of complete dsa course by love babbar
@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.
@ayushkushwaha1712 жыл бұрын
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-kt5jr2 жыл бұрын
what is your progress now
@itsmeakash_ Жыл бұрын
Progress?
@MrFaraziOfficial Жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@truptichoudhary9466 Жыл бұрын
@@MrFaraziOfficial Thanks So much your notes are very much helpfull for me
@aditibandewar16494 ай бұрын
@@MrFaraziOfficial age ke notes kaha hai
@raghavsinghal222 жыл бұрын
I don't understand the problem of a unique number of occurrences because all are using maps and all.
@SaurabhKumar-ck7yb2 жыл бұрын
#include using namespace std; bool myfunc(int a[]){ for(int i = 1; i
@kanikagupta28062 жыл бұрын
@@SaurabhKumar-ck7yb ty for this
@rameshmalhotra95252 жыл бұрын
kzbin.info/www/bejne/qnK0en6bZbp6fpY
@ronitsingh59262 жыл бұрын
Bhai ye O(n) me kaha hoo raha h ?
@amarjeetyadav264362 жыл бұрын
@@SaurabhKumar-ck7yb ye kya hua
@amankumbhalwar2 жыл бұрын
जो कठिनाईयों से सीखता है, वही आसानी से समझा सकता है । जय श्री कृष्ण ❤🙇♂️🙏
@Op-fire-qq8xl2 ай бұрын
Swap alternate start=0; end=1; While(end
@Master-sy8si2 жыл бұрын
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!!
@aryanisgoodАй бұрын
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
@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 Жыл бұрын
thanks bhai
@mmujtabah2 күн бұрын
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]); }
@k.pavansai30562 жыл бұрын
Please Explain Hash Maps. This is being used to solve many questions including The LeetCode's Find unique occurrences
@kishanprajapati69272 жыл бұрын
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 .
@kishanprajapati69272 жыл бұрын
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 .
@rameshmalhotra95252 жыл бұрын
kzbin.info/www/bejne/jpPEcmRjd65gsNk
@piyushsinha99892 жыл бұрын
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
@Rutik99992 жыл бұрын
@@piyushsinha9989 he is not talking about index, he is just explaining in terms of values
@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 Жыл бұрын
Nhi chla bhai Tera bhi code🥴
@rahul_kumar_bhagat Жыл бұрын
@@AmanSingh-cc2ci yaha n-1 ke jagh pe n+1 laga ke dekho
@animeshsahoo-yo1tt4 күн бұрын
bruh formula to shi se laga de
@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
@abhishekverma15282 жыл бұрын
Bhaiya "we are ready for continuous lecture" bas 3-4 month me khatm kara do with quality content . Jai hind. Dhanywaad bhrata shree 💙
@vitragrathi65222 жыл бұрын
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
@sagarbgmi53372 жыл бұрын
nice buddy
@dikshajain98452 жыл бұрын
Homework: 1. Unique Number of Occurrences bool uniqueOccurrences(vector& arr) { int n = arr.size(); unordered_map m; for(int i=0;i
@deepak_chourasiya21102 жыл бұрын
Help me plz
@sowtheshv9904 Жыл бұрын
sort function in finding duplicates uses time complexity of nlogn
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 Жыл бұрын
nice
@changed217 Жыл бұрын
Quite tough of a lecture, for me at least, thank you for teaching with such patience.
@fuasteriskk Жыл бұрын
it was damn tough didn't understand much
@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
@saadtariq119911 ай бұрын
yaar damn tough this lecture was..
@primeop85768 ай бұрын
@@newhope5729 just include the library stdc bro it will work
@VishalKumar-lk1pt7 ай бұрын
Quite😢
@soham_mondal2 жыл бұрын
23:10 How the xor operator works? Specially with integers 26:55 39:38 How to do it? 1:33:33
@hum__shyam2 жыл бұрын
Bro watch previous video!
@brayansaldanha83582 жыл бұрын
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
@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 Жыл бұрын
use c++ bro
@parthagarwal35224 ай бұрын
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.
@tomiokascuteness1909 Жыл бұрын
(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 Жыл бұрын
thanks for this solution :)
@cuteanime22 жыл бұрын
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.
@ritomukherjee83892 жыл бұрын
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_2 жыл бұрын
is mid =n/2 ?
@priyanshumahukhaye6282 Жыл бұрын
@@avinash__02_ no
@vineetgupta6813 Жыл бұрын
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 Жыл бұрын
@@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 :)
@ALOKKUMAR-qj2bw2 жыл бұрын
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 Жыл бұрын
Can I Connect With You
@khatariinsaan5284 Жыл бұрын
@ROCKSTAR GAMES VI Can I connect with you...
@nikhill0411 Жыл бұрын
@@khatariinsaan5284 Can I connect with you....
@newhope5729 Жыл бұрын
@@nikhill0411 Can I connect with you.....
@itzmranonymous Жыл бұрын
@@nikhill0411 Can I connect with you.....
@_Itachiii11 ай бұрын
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
@devanshuu11 ай бұрын
it wont work for even sized arrays
@_Itachiii11 ай бұрын
@@devanshuu it is working
@mmujtabah2 күн бұрын
@@devanshuu it works for both even & odd
@ellis-pr7hh2 жыл бұрын
HOMEWORK QUES 2) Find All Duplicates in an Array vector findDuplicates(vector& nums) { vectorv; sort(nums.begin(), nums.end()); for(int i=0; i
@anikettripathi92382 жыл бұрын
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.
@itsengineer32632 жыл бұрын
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
@debaroonniyogi76292 жыл бұрын
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
@sarveshkulkarni62872 жыл бұрын
@@debaroonniyogi7629 class Solution { public: bool uniqueOccurrences(vector& arr) { int ct[1000]={0}; int n=arr.size(); for(int i=0;i
@debaroonniyogi7629 Жыл бұрын
@@niteshsaxena1066 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
@ananwitasarkar93312 жыл бұрын
@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....
@mohitdodeja66882 жыл бұрын
Hey do you have your approach as I'm really stuck at h/w questions for nearly day.. if possible please do help.
@mdfarhanali3052 жыл бұрын
@@mohitdodeja6688 I also got stuck in homework questions
@mohitdodeja66882 жыл бұрын
@@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
@ritikagrover27242 жыл бұрын
01:14:53 - Ques7 - Sort 0 1 🔸void sort_01(int arr[], int n) { int i = 0, j = n - 1; while(i
@YugiPlayz Жыл бұрын
Sahi... andar loop lagane ka zarurat nahi hai!
@travelvlogs19728 күн бұрын
@@YugiPlayzi also thought why loop inside while , we can check it with if else
@ShiwanaGhai3 ай бұрын
I love that you explain everything two times atleast. Thank you!
@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 Жыл бұрын
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 🙏🙏🙏🙏
@ankitkeshri91532 жыл бұрын
This is the best course I have ever seen. I appreciate your hard work Bhaiyaa. ❤
@munnakrish35722 жыл бұрын
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--; } } }
@sambhavsharma27802 жыл бұрын
Nice Approach bro 👌
@jawhoralikhan25412 жыл бұрын
Bhaiya aise hi darshate rahiye❤❤❤
@juniorgaming5874 Жыл бұрын
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
@ashishpandey2002 Жыл бұрын
Aapki videos bohot simple and straight forward hoti hai aapka language ekdum synchronized feel hota hai at the end maza ata hai🙏🙏♥♥
@AayushGoyal2 жыл бұрын
For swapping alternate elements: void swapAlt(int arr[], int size){ int a=0,b=1; while(b
@deepakkansal9112 Жыл бұрын
mne b ese hi try kiya
@rishabjha2003 Жыл бұрын
At 1: 11 08 pr loop n-1 tak kyu chal rha hai sir
@anshbhatia98232 жыл бұрын
Another method for alternate swap(without using if condition): void alternateSwap(int arr[], int size){ for(int i = 0; i
@okaybossiamonyoutubeakkskd2 жыл бұрын
( i < size -1 ) and ( i + 1 < size ) are literally the same thing. don't call this as a "method"
@kankanaki43682 жыл бұрын
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
@kushalshivhare4366 Жыл бұрын
but isme agar 2 do baar aa rha hai dono array mein to 2 do bar print hoga......but hme to unique print krna h vo kse kre?
@no_1313 Жыл бұрын
@@kushalshivhare4366 Do bar aye to do bar he hoga, unique element wise dekhna hai, ek pair dubara use nahi hoga
@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
@shindeshankar50228 ай бұрын
Bhaiya , in swap alternative question we can apply condition in loop if(i%2!=0) then swap i with i-1 and get the output for both even and odd array😀
@lekhanachidananda9 ай бұрын
Find Unique element in the array(my approach): int findUnique(int *arr, int size) { for(int i=0;i
@vikasyadav-vq2fu Жыл бұрын
Thank you so much Babbar bhaiya !! For providing your precious knowledge here, so glad to learn this.
@amarnathprajapati25432 жыл бұрын
Completed such a amazing session with honesty.
@bhaveshs17452 жыл бұрын
Thank you so much for this series Bhai 🔥 Har video ke saath excitement badhte hi jaa rahi hai ab 💯
@visheshkaran70832 жыл бұрын
True
@akshitamishra186 ай бұрын
bhaiyaa abhi tak ka phla video arrays ka jo samajh ayyaaa.....Thankyou so much
@pratik40803 күн бұрын
love you
@rockycinema2499 Жыл бұрын
Ha bhai mene 1h 40 m 13 se ki to nhi par 1:34:54 ki video puri dekli Or ise pura dekhne me mujhe 10 hour lag gye kyoki aapke questions solve karane se pahle 1/2 ek ghanta mene try kiya phir video phir try
@adarshpandey25152 жыл бұрын
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
@onkarlapate272 жыл бұрын
Thanks for giving homework questions on leetcode!!
@mehaksharma93912 жыл бұрын
did uh find the soln of unique occurence ques...without hasmaps
@garvgupta42198 ай бұрын
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?
@MohdSaifEC7 ай бұрын
Maine XOR karke kara tha question toh 54/69 testcases pass hue submit he ni ho rha h...
@pratyakshdixit75765 ай бұрын
@@MohdSaifEC Solution bhej sakte ho bhai
@MohdSaifEC5 ай бұрын
@@pratyakshdixit7576 bro dhundna pdega yaar...
@chinmayeemohapatra9233 Жыл бұрын
mazaa aaraha hai question solve krne me... 10 baby steps ✅... More ahead to complete🔥
@funlearning59896 ай бұрын
video completed.... consistency is power...lets see the magic
@hermionegranger64932 жыл бұрын
Enjoying this series!Amazing work!
@awais_ansarii2 жыл бұрын
Such a Great Session Sir❣️ Enjoying watching the entire playlist... Huge Respect ❣️
@MrFaraziOfficial Жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@sanajitbhunia688 Жыл бұрын
Sir, please provide the answers to LeetCode homework problems as it will help us find accurate solutions.
@KrishnaGupta-bp1ny9 ай бұрын
get in leetcode discussion section
@niveshkothari9 ай бұрын
@@KrishnaGupta-bp1ny Where?? Discord ?m
@Mohan_lal_gupta9 ай бұрын
@@niveshkothari In question screen, you will get on the top named *solution*
@motivation_with_harsh4 ай бұрын
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(); } };
@PrankurGarg Жыл бұрын
In pair sum question, if we take input as 4 2 1 1 1 1 Here, four elements in array and pair sum should equals to 2. Output should be : (1,1) (1,1) But by the above approach the output is (1,1) (1,1) (1,1) (1,1) (1,1) (1,1) .
@sakshibhokare56302 жыл бұрын
You are fantastic bhaiya💖 I got my interest in coding just because of you!!! thank you so much 😊
@mahekhingorani79633 ай бұрын
tough lecture :(
@sounaksaha14552 жыл бұрын
2 days late, but still watched the whole video in one shot. Thanks bhaiya for providing such quality content. We are grateful to you.
@YashKumar-ww4sg Жыл бұрын
First of all thank you sir providing a great content for free of cost with detailed depth analysis of topics and question. Sir I have a question that in Sort 0 1 question that if we are using in first while loop that left
@MehakMalhotra-bj2ce3 ай бұрын
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
@amigoplayz30993 ай бұрын
thanks brother. helped a lot. solved my 1st problem.
@tusharrathore26102 жыл бұрын
Unique Number of Occurrences : Solution(Using only Arrays): sort(arr.begin(),arr.end()); vector v; int num = 0; for (int i = 0; i
@YogeshBora07 Жыл бұрын
do i need to learn STL for these questions ?
@harshitchaubey82742 жыл бұрын
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
@infernogamer52 Жыл бұрын
COMPLETED AT 08:39 ON 15-12-2022 LIKED IT VERY MUCH NEXT TARGET: LEC #11
@KritiYadavcoding4 ай бұрын
Isse dekhne mei 3 din lgg gyaa .may be thoode new concept aur questions thee iss liye but now its time to buckle up
@adityasahni5262 Жыл бұрын
1:15:44 By counting num of 0s and 1s in 1 traversal and then updating values of array in 2nd traversal. Complexity will be O(2n) = O(n) Code: #include void sort012(int *arr, int n) { int num0 = 0, num1 = 0; for(int i = 0; i
@AVINASHKUMAR-fk6sk2 жыл бұрын
for the unique number problem we can also subtract the sum of the array from sum of numbers from 1 to n-1
@ayushpal43895 ай бұрын
nice approch
@khemchand6431 Жыл бұрын
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 Жыл бұрын
era*
@kankanaki4368 Жыл бұрын
you are giving money for internet
@apoorvasunkad66862 жыл бұрын
These videos are really helpful 👍🤗 Thank you for the Course 😀
@kartikbathla2030 Жыл бұрын
Love bhaiya @8:18 swaping alternate terms questions what if we first analyse that the given arrays is odd or even and then we write for loop separately..... The code for this situation would be as- # include using namespace std; int main(){ int n; cin>>n; int arr[n]; for(int i=0; i>arr[i]; } int k=(n-1); if(n%2==0){ for(int i=0; i
@mridulabanarjee43132 жыл бұрын
Great explanation , first time getting confidence in solving questions. Thank you so much ❤❤
@AnirudhVishwakarma-e2u Жыл бұрын
homework kuch jyada tough nhi hai🥲🥲mujhe to solve karte karte rona aa rha hai
@exploringme278Ай бұрын
😢
@soniasaleem388015 күн бұрын
H.w easy b ho tough lgta ha bro 😂 q k khd krna prta ha
@Corporate_slaves Жыл бұрын
kya yha pr akela mai hi hun jo solution dekhne ke baad bhi khud se try kr rha h fir bhi answer galat jaa rha h
@dnspavankumar6952 ай бұрын
Yes
@taranggupta11272 ай бұрын
nhi yaar , hota h
@hinduism40872 ай бұрын
Galat nahi ja raha logic hi galat ho ja raha hai
@shagunkumarrosawan9410Ай бұрын
Sahi ma bhai
@construction.life1625Ай бұрын
Nahi yar mujhse bhi nahi ho rha, mujhe lagta hai ki inka function inbuilt hai, aur ham sahi se function nahi use kar pa rhe hai
@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; } };
@umangpatel85072 жыл бұрын
Duplicates in Array Problem You used two for loops for finding array xor and xor of 1 to n-1 Can we used one loop Like This :--- int ans = 0; for(int i = 0; i < arr.size();i++){ ans = ans^arr[i]^ i; } return ans; ans^arr[i]^ i; we know that for we run from i to n-1 only so why not calculated in single for loop all AT ONCE .
@sameershah1492 Жыл бұрын
Bhaiya just becouse of you im placed in MicroSoft
@sumitkumbhkarn10 ай бұрын
solution at 37:42 doesn't work for test cases like [2,2,2,2,2]
@inbuiltengineer8368 ай бұрын
unique element ko maine try kiya aur kar bhi liya aur usme maine 50 line ka code likha aur bhai ne 3 line me khatam kar diya
@mahigour7124 Жыл бұрын
Swap alternate different method:- for (int i = 0; i < size-1; i+=2) { swap(arr[i],arr[i+1]); }
@faysalmahmud2721 Жыл бұрын
#include using namespace std; int main() { int size, sum = 0; cin >> size; int arr[10]; for(int i=0; i> arr[i]; sum += arr[i]; } cout
@LifeStoryAshita2 жыл бұрын
Your way of teaching is truely awesome, the only thing i would request is to please upload video lil fast or on daily basis, if is possile!! vo editing vale bhiaya aa gye na to please!!
@CodeHelp2 жыл бұрын
Next 7 days 7 videos
@LifeStoryAshita2 жыл бұрын
@@CodeHelp 🤩 wow Thank Thank You so much
@chitranshverma18225 ай бұрын
Bhaiya Leetcode ke homework questions toh bilkul bhi nai bn rahe ....pls guide,,.... discussion is soo difficult... somebody pls help
@pranavpatil40954 ай бұрын
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 ;_;
for swapping elements I removed the if condition and instead, added the condition in for loop. for (int i = 0; (i < size & i + 1 < size); i += 2) { swap(arr[i], arr[i + 1]); }
@tejashmaurya2149 Жыл бұрын
Find all duplicates class Solution { public: vector findDuplicates(vector& nums) { vector ans; sort(nums.begin(),nums.end()); for(int i=0;i
@yashdeshmukh88532 жыл бұрын
Pataa nhi questions easy hogaye ya mujhe lag rahe 😅 Shayd sikhane wale ka kamaal hoga 😁 Op bhaiya 🔥🔥
@surendrajat7290 Жыл бұрын
i can't express my self , thank you for such videos sir .
@leoxse4 ай бұрын
Sir I can you explain me what is vector ?
@satvikchauhan8511 ай бұрын
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
@rohitkhatri38928 ай бұрын
Question 3 can also be done by summing all the elements of the array and then subtracting the sum of first n-1 integers
@033_rajatsingh2 Жыл бұрын
Most of the questions are based on vectors so should id do these questions after learning the STL for better understanding?