Posts

DC's DSA-CRACKER #6 | Array | Find union and intersection of 2 Sorted Arrays

Image
Array  This is a part of the 450 DSA question set to check the Excel sheet link to see the Links to GFG, Questions, Explanation/Solving Video, or other Blog for the Question: https://drive.google.com/file/d/1L3EOLDMs-Fx2XoKclkCg1OVymDGh6psP/view?usp=sharing Question  : Given 2 unsorted arrays A, and B, find the union and intersection of these arrays. and solve it in less than O(m*n) time Complexity. (Best Solution can be via the use of a SET) Explanation Video CODE Tip: Check the code from the GITHUB Repo to Download the Code of all Existing Questions Solved at Once Python     Credit (for the Collection of Questions) :  The Excel sheet is made by Mr.Love Babbar check him out on YT too (After Subscribing to my channel too First ✌) Want to Contribute? Add Your GitHub Repo with the solution in other Programming Languages (C, CPP, Java, etc....)

DC's DSA-CRACKER #5 | Array | Move all Negative numbers to one side of the Array

Image
Array  This is a part of the 450 DSA question set to check the Excel sheet link to see the Links to GFG, Questions, Explanation/Solving Video, or other Blog for the Question: https://drive.google.com/file/d/1L3EOLDMs-Fx2XoKclkCg1OVymDGh6psP/view?usp=sharing Question  : Move all negative numbers to the beginning and all positive numbers to the end while using constant extra space. Explanation Video CODE Tip: Check the code from the GITHUB Repo to Download the Code of all Existing Questions Solved at Once Python     Credit (for the Collection of Questions) :  The Excel sheet is made by Mr.Love Babbar check him out on YT too (After Subscribing to my channel too First ✌) Want to Contribute? Add Your GitHub Repo with the solution in other Programming Languages (C, CPP, Java, etc....)

DC's DSA-CRACKER #4 | Array | Sort the array without using a sorting algorithm

Image
Array  This is a part of the 450 DSA question set to check the Excel sheet link to see the Links to GFG, Questions, Explanation/Solving Video, or other Blog for the Question: https://drive.google.com/file/d/1L3EOLDMs-Fx2XoKclkCg1OVymDGh6psP/view?usp=sharing Question  : Given an array of size N containing only 0s, 1s, and 2s; sort the array in ascending order without using a conventional sorting algorithm. Explanation Video CODE Tip: Check the code from the GITHUB Repo to Download the Code of all Existing Questions Solved at Once Python     Credit (for the Collection of Questions) :  The Excel sheet is made by Mr.Love Babbar check him out on YT too (After Subscribing to my channel too First ✌) Want to Contribute? Add Your GitHub Repo with the solution in other Programming Languages (C, CPP, Java, etc....)

DC's DSA-CRACKER #3 | Array | Kth Maxima and Minima in an Array

Image
Array  This is a part of the 450 DSA question set to check the Excel sheet link to see the Links to GFG, Questions, Explanation/Solving Video, or other Blog for the Question: https://drive.google.com/file/d/1L3EOLDMs-Fx2XoKclkCg1OVymDGh6psP/view?usp=sharing Question  : Given an array and an integer K where K is smaller than the size of the array, find the Kth smallest element in the given array, given that all the elements in the array are distinct. Explanation Video CODE Tip: Check the code from the GITHUB Repo to Download the Code of all Existing Questions Solved at Once Python     Credit (for the Collection of Questions) :  The Excel sheet is made by Mr.Love Babbar check him out on YT too (After Subscribing to my channel too First ✌) Donation Link :  If You want to Donate for the effort of making these Solutions out for free and not making a course/Selling it on websites etc please consider it! Donate Here Want to Contribute? Add Your GitHub Re...

DC's DSA-CRACKER #2 | Array | Maxima and Minima in Array

Image
Array  This is a part of the 450 DSA question set to check the Excel sheet link to see the Links to GFG, Questions, Explanation/Solving Video, or other Blog for the Question: https://drive.google.com/file/d/1L3EOLDMs-Fx2XoKclkCg1OVymDGh6psP/view?usp=sharing Question  : Maximum and Minimum Element in an Array Write a Function that finds out the maximum and minimum element inside an array via the minimum comparisons possible and in the most minimal Space and Time Complexity. Explanation Video CODE Tip: Check the code from the GITHUB Repo to Download the Code of all Existing Questions Solved at Once Python     Credit (for the Collection of Questions) :  The Excel sheet is made by Mr.Love Babbar check him out on YT too (After Subscribing to my channel too First ✌) Donation Link :  If You want to Donate for the effort of making these Solutions out for free and not making a course/Selling it on websites etc please consider it! Donate Here Want to Contri...

DC's DSA-CRACKER #1 | Array | REVERSE THE ARRAY

Image
  Array  This is a part of the 450 DSA question set to check the  Excel sheet  link to see the Links to GFG, Questions, Explanation/Solving Video, or other Blog for the Question: https://drive.google.com/file/d/1L3EOLDMs-Fx2XoKclkCg1OVymDGh6psP/view?usp=sharing Question:  Reverse the Given Array   Example :   I/P : [1,2,3,4,5,6,7] O/P : [7,6,5,4,3,2,1]   Question Reference Link : https://www.geeksforgeeks.org/write-a-program-to-reverse-an-array-or-string/ Explanation Video CODE Tip: Check the code from the  GITHUB Repo  to Download the Code of all Existing Questions Solved at Once Python   Credit (for the Collection of Questions)  :  The Excel sheet is made by Mr.Love Babbar check him out on  YT  too (After Subscribing to my channel too First ✌) Donation Link :  If You want to Donate for the effort of making these Solutions out for free and not making a course/Selling it on website...

Google Kickstart Round D 2k20 | Alien Piano problem (7,11)

Image
KICK-START ROUND D SOLUTION RECORD BREAKER PROBLEM (7pts,11pts) Problem Explanation : Code in Python : def   main ():     n =  int ( input ())     arr =  list ( map ( int ,  input ().split()))     t1, t2, count =  0 ,  0 ,  0      for  i  in   range (n):          if  arr[i] > arr[i -  1 ]:             t1 +=  1             t2 =  0              if  t1 ==  4 :                 t1 =  0               ...