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_29 Жыл бұрын
bro do u have hand written notes?
@codingriovo631 Жыл бұрын
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
@rameshwari3 жыл бұрын
You're killing it🌟🌟 Keep posting till the end of the series.
@MrFaraziOfficial2 жыл бұрын
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
@jethalal4848Күн бұрын
Hlo bro
@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 Жыл бұрын
nice
@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 Жыл бұрын
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
@adityasinghrawat66643 ай бұрын
@@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
@adityasinghrawat66643 ай бұрын
@@AmanSingh-cc2ci bhai chlra hai uska code
@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_arena7 ай бұрын
@@shivprasadshinde2577bro tumne agar count =0 pakda hai toh j+1 nahi Kiya toh bhi chalega n
@cuteminired65507 ай бұрын
Thanks 😊
@praveenwandhekar9114 ай бұрын
@@lokeshmethani2656 Kyu nahi ho sakta ho sakta hai na
@ayushkushwaha1713 жыл бұрын
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_2 жыл бұрын
Progress?
@MrFaraziOfficial2 жыл бұрын
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
@aditibandewar16498 ай бұрын
@@MrFaraziOfficial age ke notes kaha hai
@amankumbhalwar3 жыл бұрын
जो कठिनाईयों से सीखता है, वही आसानी से समझा सकता है । जय श्री कृष्ण ❤🙇♂️🙏
@prasadcode582 жыл бұрын
I am now clearly understanding about arrays, even I also learned about vectors and its methods, thanks guruji!!! ❤
@MrFaraziOfficial2 жыл бұрын
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.
@funlearning598910 ай бұрын
video completed.... consistency is power...lets see the magic
@raghavsinghal223 жыл бұрын
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
@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 ?
@priyanshumahukhaye62822 жыл бұрын
@@avinash__02_ no
@vineetgupta68132 жыл бұрын
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 :)
@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!!
@ashishpandey2002 Жыл бұрын
Aapki videos bohot simple and straight forward hoti hai aapka language ekdum synchronized feel hota hai at the end maza ata hai🙏🙏♥♥
@parthagarwal35228 ай бұрын
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.
@cuteanime23 жыл бұрын
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.
@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
@kartikkothekar68623 ай бұрын
☠💀
@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!
@travelvlogs19724 ай бұрын
@@YugiPlayzi also thought why loop inside while , we can check it with if else
@AMITSHARMA-zt4ee9 ай бұрын
Great . itna acha content free me
@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
@ahmadrasheed25983 ай бұрын
Current Progress (also from Pakistan)
@ankitkeshri91532 жыл бұрын
This is the best course I have ever seen. I appreciate your hard work Bhaiyaa. ❤
@dikshajain98453 жыл бұрын
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
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
@Op-fire-qq8xl6 ай бұрын
Swap alternate start=0; end=1; While(end
@mkrstudypoint648126 күн бұрын
this condition is working fine for even number of elements but not for odd ones
@akshitamishra1810 ай бұрын
bhaiyaa abhi tak ka phla video arrays ka jo samajh ayyaaa.....Thankyou so much
@prkilmmm3 ай бұрын
love you
@jawhoralikhan25413 жыл бұрын
Bhaiya aise hi darshate rahiye❤❤❤
@abhishekverma15283 жыл бұрын
Bhaiya "we are ready for continuous lecture" bas 3-4 month me khatm kara do with quality content . Jai hind. Dhanywaad bhrata shree 💙
@shubhamjangle76333 жыл бұрын
Only Two words - "QUALITY CONTENT"🤩🤩
@ShiwanaGhai7 ай бұрын
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 🙏🙏🙏🙏
@shahtanmay9022 жыл бұрын
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 Жыл бұрын
bro in this question why we are unable to use sort(arr.begin(), arr.end());
@adityanarayan5641 Жыл бұрын
@@parth6661because it is an array, but we can do this sort for vectors.
@parth6661 Жыл бұрын
@@adityanarayan5641 ohkk thanks bro
@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
@AnkurWrites3 ай бұрын
Yeah exactly.
@ALOKKUMAR-qj2bw3 жыл бұрын
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 ☝️☝️🙏
@saurabhfreefire22052 жыл бұрын
Can I Connect With You
@khatariinsaan5284 Жыл бұрын
@ROCKSTAR GAMES VI Can I connect with you...
@Kumar04111 Жыл бұрын
@@khatariinsaan5284 Can I connect with you....
@newhope5729 Жыл бұрын
@@Kumar04111 Can I connect with you.....
@itzmranonymous Жыл бұрын
@@Kumar04111 Can I connect with you.....
@chinmayeemohapatra92332 жыл бұрын
mazaa aaraha hai question solve krne me... 10 baby steps ✅... More ahead to complete🔥
@motivation_with_harsh8 ай бұрын
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_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!
@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
@Ashutoshkumar-qf4ne3 жыл бұрын
This course really help me to understand the concepts very well. Thank you so much LOVE BABBAR Sir.
@YashSaxena1-s6l10 ай бұрын
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 ❤🙏
@bernardhackwell44102 жыл бұрын
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
@HKClasher2 жыл бұрын
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.
@aryanmalik9192 жыл бұрын
@@HKClasher exactly that is what i was thinking why he used loops when if else can be used instead
@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?
@MohdSaifEC11 ай бұрын
Maine XOR karke kara tha question toh 54/69 testcases pass hue submit he ni ho rha h...
@pratyakshdixit75769 ай бұрын
@@MohdSaifEC Solution bhej sakte ho bhai
@MohdSaifEC9 ай бұрын
@@pratyakshdixit7576 bro dhundna pdega yaar...
@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
@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 Жыл бұрын
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 Жыл бұрын
it wont work for even sized arrays
@_Itachiii Жыл бұрын
@@devanshuu it is working
@mmujtabah3 ай бұрын
@@devanshuu it works for both even & odd
@sumitkumbhkarn Жыл бұрын
solution at 37:42 doesn't work for test cases like [2,2,2,2,2]
@sparshgamer15823 ай бұрын
Pls give solution for this test case
@vikasyadav-vq2fu2 жыл бұрын
Thank you so much Babbar bhaiya !! For providing your precious knowledge here, so glad to learn this.
@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
@saadtariq1199 Жыл бұрын
yaar damn tough this lecture was..
@primeop8576 Жыл бұрын
@@newhope5729 just include the library stdc bro it will work
@VishalKumar-lk1pt11 ай бұрын
Quite😢
@Shakti_singh966 ай бұрын
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 Жыл бұрын
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 Жыл бұрын
how did you solve first lead code problem??
@GOJOANDSUKUNAFAN9 ай бұрын
@@priyanshurathore8098it's fucking easy 💀
@chitranshverma18229 ай бұрын
Bhaiya Leetcode ke homework questions toh bilkul bhi nai bn rahe ....pls guide,,.... discussion is soo difficult... somebody pls help
@pranavpatil40958 ай бұрын
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_Dharma2 жыл бұрын
sir please explain unique number of occurences. because maximum solutions in the discussion forums of leetcode are using Hashmap.
@delta_mohit Жыл бұрын
+1
@aadarshdubey5738 Жыл бұрын
can you please share the code
@UPSC_IAS_IPS_0072 жыл бұрын
this video take my 8 hour approx to complete it. thanks bhaiya for helping us
@sataesthetic2 жыл бұрын
bhaiya maine aapki video puri dekhi or mujhe to bhot he maza aaya!
@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)
@hermionegranger64932 жыл бұрын
Enjoying this series!Amazing work!
@amarnathprajapati25432 жыл бұрын
Completed such a amazing session with honesty.
@ispetter653710 ай бұрын
Sorting of 0&1 can be done easily with replacing inside while loop with if else if, Customized 🎉🎉
@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; } };
@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
@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
@sounaksaha14553 жыл бұрын
2 days late, but still watched the whole video in one shot. Thanks bhaiya for providing such quality content. We are grateful to you.
@tomiokascuteness19092 жыл бұрын
(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 :)
@krato8731 Жыл бұрын
bhot bdia video thi bhaiya small correction at 1:31:00 use if instead of while then you wont need to write "& left
@adarshpandey25153 жыл бұрын
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
@nikhilrauniyar90842 жыл бұрын
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 Жыл бұрын
Yes this the easiest and fastest method thanks brother
@fouzan.f9875 Жыл бұрын
thanks bro
@prakharbansal4748 Жыл бұрын
TLE
@bhaveshs17453 жыл бұрын
Thank you so much for this series Bhai 🔥 Har video ke saath excitement badhte hi jaa rahi hai ab 💯
@visheshkaran70833 жыл бұрын
True
@mahigour7124 Жыл бұрын
Swap alternate different method:- for (int i = 0; i < size-1; i+=2) { swap(arr[i],arr[i+1]); }
@GaneshKumatole Жыл бұрын
1:00:00 loved this one ... 🔥🔥🔥♥️♥️♥️👍👍👍 Thank you Bhaiya .
@aryanisgood5 ай бұрын
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_ansarii2 жыл бұрын
Such a Great Session Sir❣️ Enjoying watching the entire playlist... Huge Respect ❣️
@MrFaraziOfficial2 жыл бұрын
lecture 9 and 10 notes - google drive drive.google.com/drive/folders/1xAtc-ETQdL8PqWWsbEslefKbue3zYEeE?usp=share_link
@balbirMs3 жыл бұрын
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_2862 жыл бұрын
.
@a092devs2 жыл бұрын
Can you explain this? a(arr+0,arr+n);
@leenapatil69722 жыл бұрын
Hey.. can you explain?
@parthsatvekar5411 Жыл бұрын
literally one of the best coding teacher on yt
@Vedo-e5b8 ай бұрын
Isse dekhne mei 3 din lgg gyaa .may be thoode new concept aur questions thee iss liye but now its time to buckle up
@sakshibhokare56303 жыл бұрын
You are fantastic bhaiya💖 I got my interest in coding just because of you!!! thank you so much 😊
@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
@debaroonniyogi76292 жыл бұрын
@@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
@adityasinghrawat66643 ай бұрын
@@debaroonniyogi7629 thanks bro for sharing this solution i have learned many new things out of it this helpwd me a lot
@ananwitasarkar93313 жыл бұрын
@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
@adityasinghdangi69085 ай бұрын
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
@narutoYT192 ай бұрын
bool find(int arr[] , int size){ for(int i =1 ; i
@Nitin_Kumar_Singh4 ай бұрын
26:55 bhaiya ye question nhi solve ho raha hai aur discussion me hashmap ka solutions hai
@AarrtiManocha3 ай бұрын
bhai hua solve ??
@harshitchaubey82743 жыл бұрын
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
@khemchand64312 жыл бұрын
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
@amaanahmad16932 жыл бұрын
era*
@kankanaki4368 Жыл бұрын
you are giving money for internet
@anuradha38682 жыл бұрын
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-lj5wf2 жыл бұрын
@sarthakgupta1321 Жыл бұрын
int findDuplicate(vector &arr) { int sum=0; int newSum =0; for(int i=0;i
@munnakrish35723 жыл бұрын
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 👌
@shubh-kr2 жыл бұрын
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 Жыл бұрын
hey i can't even solve this problem T_T
@shubh-kr Жыл бұрын
@@kshitizsharma4461 now that you're here, I'm sure you'll.
@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
@mmujtabah3 ай бұрын
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]); }
@juniorgaming58742 жыл бұрын
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
@Ultrabee18022 ай бұрын
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; } };
@apoorvasunkad66863 жыл бұрын
These videos are really helpful 👍🤗 Thank you for the Course 😀
@033_rajatsingh2 Жыл бұрын
Most of the questions are based on vectors so should id do these questions after learning the STL for better understanding?
@onkarlapate273 жыл бұрын
Thanks for giving homework questions on leetcode!!
@mehaksharma93912 жыл бұрын
did uh find the soln of unique occurence ques...without hasmaps
@rehanhussan2 жыл бұрын
Complete Video maine Dekh liya bhoot Maza aaya
@MehakMalhotra-bj2ce7 ай бұрын
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
@amigoplayz30997 ай бұрын
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 ?
@I_Anupam_Pandey3 жыл бұрын
37:43 Can anyone explain me why in 2nd for loop ans=ans^i instead of ans=ans^arr[i]; ?
@shoumickbardhan14602 жыл бұрын
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.
@surendrajat72902 жыл бұрын
i can't express my self , thank you for such videos sir .