Welcome to my DSA Concept Practice repository! Here you'll find my solutions to various Data Structures and Algorithms problems, coded in C++.
I'm committed to improving my DSA skills, and what better way to do it than by practicing regularly? Each day, I'll be adding a new problem along with its solution in this repository. So, feel free to explore, learn, and contribute!
I'll be updating this section daily to keep you informed about the latest additions to the repository.
Back wuth the series in 2025❗
-
Added subArraywithXOR_Better.cpp:Return the largest sub array with 0 sumLink to Question❓
-
Added subArraywithXOR_Optimal.cpp:Return the largest sub array with 0 sumLink to Question❓
-
Added pairSumLess.cpp:Find number of pairs whose sum is less than the targetLink to Question❓
- Added subArraywithXOR_Brute.cpp:Return the largest sub array with 0 sumLink to Question❓
-
Added fourSum_optimal.cpp:Four Sum problem optimal method with no extra spaceLink to Question❓
-
Added largestSubArrayWith0Sum.cpp:Givnig the largest subarray wth sum 0, similar to kadane algorithmLink to Question❓
-
Added fourSum_Brute.cpp:four sum problem the brit e forceLink to Question❓
-
Added fourSum_Better.cpp:four sum porblem a better approachLink to Question❓
-
Added threeSum.cpp:three Sum problem Link to Question❓
-
Added threeSum_Better.cpp:three Sum problem Link to Question❓
- Added majorityN3.cpp: Returns array of majority n/3 elemtns Link to Question❓
- Added pascalTriangle.cpp: Returns upto the nth row of the pascal triangle Link to Question❓
- Added subArraySumK.cpp: Returns number of subarray that can sum up to KLink to Question❓
-
Added markZeroes_Brute.cpp:if matrix conatins zero mark the entire row and column as zero. Link to Question❓
-
Added markZeroes_Bool.cpp:if matrix conatins zero mark the entire row and column as zero. Link to Question❓
-
Added markZeroes_Better.cpp:if matrix conatins zero mark the entire row and column as zero. Link to Question❓
-
Added rotate3x3Matrix90.cpp:Rotate 3x3 matrix by 90 Degrees. Link to Question❓
-
Added rotateMatrix90_Brute.cpp:Rotate any sqaure Matrix by 90 Degrees Link to Question❓
-
Added rotateMatrix90_Optimal.cpp:Rotate any sqaure Matrix by 90 Degrees Link to Question❓
-
Added spiralMatrix.cpp:Prints all elemetns of the matrix the spiral order Link to Question❓
-
Added nextPermutation.cpp: Updates the array to next permutation.Link to Question❓
-
Added leaderInArray.cpp:Returns the element which are greatest to the element to thier right.Link to Question❓
-
Added longestConsecutive.cpp:Returns the longest consecutive array of elements number.Link to Question❓
-
Added maxSumSubArray_Array.cpp: Printing the sub array whiv has the maximum sum.Link to Question❓
-
Added stockBuyandSell.cpp: buy stock and lowest and sell at highest.Link to Question❓
-
Added rearrangeBySign.cpp: Returns the majority element which occurs more then n/2 times.Link to Question❓
-
Added majorityElementN2.cpp: Returns the majority element which occurs more then n/2 times.Link to Question❓
-
Added maximumSubArraySum_Kadane.cpp: Rearrange vector according to the order of alternative signs.Link to Question❓
-
Added twoSum_Hash.cpp: Returns the array of two numbers of elements to sum up to target.Link to Question❓
-
Added zeroOnesTwoes.cpp: Sort colors on 0,1,2. Link to Question❓
-
Added zeroOnesTwoes_Optimal.cpp: Sort colors on 0,1,2. Link to Question❓
-
Added sumArrayOfSumK_HashMap.cpp: Returns the len of the longest number of elements to sum up to k.Link to Question❓
-
Added sumArrayOfSumK_Optimal.cpp: Returns the len of the longest number of elements to sum up to k.Link to Question❓
-
Added sumOfDivisors_Optimal.cpp: Returns the len of the longest number of elements to sum up to k.Link to Question❓
-
Added twoSum_Brute.cpp: Returns the array of two numbers of elements to sum up to target.Link to Question❓
- Added sumArrayOfSumK.cpp: Returns the len of the longest number of elements to sum up to k Link to Question❓
- Added consecutiveNums.cpp: Returns The number which appears only single time ↗L.T.Q.1❓ ↗L.T.Q.2❓
-
Added findOnesSeries.cpp: Returns the number of consecutive ones in the array. ↗L.T.Q.1❓ ↗L.T.Q.2❓
-
Added missingNumber.cpp: Returns missing number. Link to Question❓
-
Added removeDuplicates1.cpp: Removes the Duplicates from the array and return the length of unique elements. Link to Question❓
-
Added removeDuplicates2.cpp: Removes the Duplicates from the array and return the length of unique elements. Link to Question❓
-
Added rotateByOne.cpp: Rotates the array by one place Link to Question❓
-
Added linearSearch.cpp: Performs linear search. Link to Question❓
-
Added moveZeroesToEnd.cpp: Moves all the zeroes of array in the end of array. ↗L.T.Q.1❓ ↗L.T.Q.2❓
- Added rotateByK.cpp:Rotate Array by K places. ↗L.T.Q.1❓ ↗L.T.Q.2❓
-
Added largestElement.cpp:Returns Largest element of the array Link to Question❓
-
Added secondLargestElement.cpp:Returns the second largest and the second smallest element Link to Question❓
-
Added isSorted.cpp:Returns if the array is sorted Link to Question❓
-
Added isRotatedIfSorted.cpp:Returns if the array is roated if given sorted Link to Question❓
-
Added isRotatedIfSorted2.cpp: [EASIER] Returns if the array is roated if given sorted Link to Question❓
-
Added countElementHash.cpp: Counting elements of a array using hashing Link to Question❓
-
Added highestLowestFreq.cpp: Returns Highest and Lowest Frequency elemets. Link to Question❓
-
Added checkFactorial.cpp: returns array containing all factorial numbers which are less than/equal to ‘n’. Link to Question❓
-
Added reverseArray.cpp:reverses array usng recursion as base. Link to Question❓
-
Added checkPalindromeString.cpp: Checks Whther the string is pallindrome or not. ↗L.T.Q.1❓ ↗L.T.Q.2❓
-
Added fibonacciSeries.cpp: Does printing and sumation of fibonacci series of n. ↗L.T.Q.1❓ ↗L.T.Q.2❓
-
Added print1ToN.cpp: Print 1 to n using recursion Link to Question❓
-
Added printNTo1.cpp:Print N to 1 using recursion Link to Question❓
-
Added printStringNTimes.cpp: Print N times a string using recursion. Link to Question❓
-
Added sum1ToN.cpp: Sum of 1 to N Recursion and no loops. Link to Question❓
-
Added sumOfAllDivisors2: Gives total sum of all divisors of that number.FIXED TIME LIMIT Link to Question❓
-
Added printAllDivisorsSTL: Returns sorted the divisors of the number. Link to Question❓
-
Added checkPrime.cpp: Checks whether a number is primeor not. Link to Question❓
-
Added nOutputUsingRecursion.cpp: Printing 1 to N using Recursion and no loops. Link to Question❓
-
Added reverseOfANumber: simple problem of reversing a integer. Link to Question❓
-
Added palindrome: Returns whether the program in palindrome or not. Link to Question❓
-
Added gcd1: A code that finds gcd of two numbers. Version 1 Link to Question❓
-
Added gcd2: A code that finds gcd of two numbers. Version 2 Link to Question❓
-
Added checkArmstrong:Returns whether the input in armstrong number or not. Link to Question❓
-
Added sumOfAllDivisors: Gives total sum of all divisors of that number. Link to Question❓
-
Added Reverse Bits: This is A modearte difficulty problem which deals with bit manipulation. Link to Question❓
-
Added reverseNumber.cpp: Reverses a number ↗L.T.Q.1❓ ↗L.T.Q.2❓
-
Added Pattern based Problems: Various Beginner Patterns Based problems all in code. Link to Question❓
-
Added Count Digits: Returns the total number of Digits that can divide the the number they reside in. Link to Question❓
If you have any suggestions, feedback, or just want to say hi, feel free to connect with me!
LinkedIN👤: Ankit-Kumar-Singh(Askit-Endo)
GitHub😼: AskitEndo
CodingNinjas🥷🏻: AskitEndo
LeetCode💽:AskitEndo
GeeksForGeeks🕶️:askitendo
Let's code and learn together! 💻✨