Skip to content

AbhinavMV/DSA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structure And Algorithm

Starting 100 Days of Code
Weekdays: Work on DP and Data Structures on Hackerrank
Weekends: Web Devlopment

Summary

1st - Unbounded Kanpsack
2nd - Variations of 0/1 Knapsack - Equal subset partition, Ones and Zeros
3rd - Variations of unbounded Knapsack - Coin Change(1 & 2), Integer Break(Like rod cutting)
4th - Variations of Binary Search and Longest Common Subsequence(LCS)
5th - Variation of LCS - printing shortest common supersequence
6th - Variation of LCS - Edit Distance (convert str1 to str2 by 3 operations-insert,delete,replace)
7th - Variation of LCS - Distinct Subsequences (find all different subsequences of word2 in word1)
8th - Variation of LCS - Minimum ASCII Delete Sum for Two Strings
9th - Variation of MCM - Minimum Score Triangulation of Polygon
10th - Count Palindromic Substrings
11th - Variation of MCM - Minimum Palindromic Substrings
12th - Variation of MCM - Burst Balloons
13th - Variation of MCM - Minimum Cost of Tree from Leaf Nodes
14th - Bottom Up Approach of MCM Variations - Minimum Score Triangulation of Polygon
15th - Bottom Up Approach of MCM Variations - Burst Balloons (Learned very important thing)
16th - Bottom Up Approach of MCM Variations - Minimum Cost Tree From Leaf Values
17th - Buy and sell stock variations - (Once Only and Infinite times)
18th - Buy and sell stock variations - (with Transaciton Fee)
19th - Buy and sell stock variations - (with cooldown)
20th - Buy and sell stock variations - (2 Transactions and K Transactions)
21st - Variations of LIS - Longest Increasing Subsequence - LIS,largest Divisible subset,russian Dolls
22nd - Variations of LIS - maximum length of pair chain
23rd - Variations of LIS - Number of Longest increasing Subsequence
24th - Variations of LIS and Knapsack - House robber 2 and delete and earn
25th - Variations of LIS - Longest String Chain
26th - Variations of Knapsack and Hash+dp - Target Sum
27th - Misc - Greatest Sum Divisible by Three
28th - DP (Max - Min) - Minimum Path Sum, Triangle
29th - DP (Max - Min) - Dungeon Game (Important concept)
30th - DP (Max - Min) - Maximal Square
31st - DP (Max - Min) - Perfect Square
32nd - DP (Max - Min) - 2 Keys Keyboard
33rd - DP (Max - Min) - Minimum Cost of Climbing stairs,Minimum Number of Refueling stops
34th - DP (Max - Min) - Minimum Falling Path Sum, Minimum Cost for Tickets
35th - DP (Unique Paths) - Unique Paths, Unique Paths 2
36th - DP (Unique Paths) - Combination Sum IV
37th - DP (Unqiue Paths) - Out of Boundary Paths (Recursive and memomized solution only)
38th - DP (Unique Paths) - Knight Probability in Chess (Backtracking)
39th - DP (Unique Paths) - Domino and Tromino Tiling
40th - DP (Unique Paths) - Minimum Swaps To Make Sequences Increasing
41st - All Easy and some medium questions of Searching on Leetcode (Listed in Searching.md)
42nd - Some medium question of Searching(Binary Search) on Leetcode
43rd - 2 Medium Questions of Searching(Binary Search) on Leetcode
44th - 2 Medium Questions of Searching(Binary Search) on Leetcode
45th - Binary Search - Search in 2D Matrix
46th - Binary Search - Find Peak in Grid, Find a duplicate number
47th - Binary Search - Capacity to Ship Packages in D days
48th - Sorting - Started With Easy questions in sorting.md
49th - Learned different types of sorting - Bubble,Selection,Insertion,Merge,Quick
50th - Sorting Questions in sorting.md
51st - Minimum Absolute Difference,Sort integers by the number of 1 bits,find disappeared Number(Cycle sort)
52nd - 2Sum
53rd - 3Sum,Combinations using recursion - Letter Combinations of a Phone Number,Number of Dice Rolls With Target Sum
54th - 3Sum-Closest,Backtracking - Theory learned
55th - 4Sum (Done using NSum recursive method),Combination Sum
56th - Word Search (backtracking),Kth Bit in Nth Binary String,Kth Symbol in Grammar
57th - Count Good Number (Good Ques - Mathematics+divide and conquer)
58th - Decode String (trick to imitate pointer functionality in c)
59th - Count winner in circular game - Josepheus problem - Recursive approach
60th - Different ways to compute
61st - Predict the Winner
62nd - Combination Sum 2 and 3
63rd - Sudoku Solver
64th - Permutations1 and 2, subsets 1 and 2, Letter tile Possibilities
65th - All Paths From Source to Target - find all paths and when current element becomes n-1 end it, Beautiful arrangement - Going from backward helps as it prunes more cases
66th - Path with Maximum Gold - Backtrack along all starting points, Tug of War - Use Target sum effectively(Geeks for Geeks question)
67th - Parsing a boolean Expression - Try using level for each '(' ')' and parse for each expression between them. base condition return whenever you find t or f
68th - Special Binary Strings - equal to valid parenthesis, sort valid paranthesis in reverse order and join.
69th - Permutation Sequence - recurisve solution give TLE try to find mathematical approach. each digit will have a region hint: nn-1n-2....
70th - Basic Calculator - Make stack solution then for brackets do recursion of this function
71st - Basic Calculator 2 - Same as but handle * and / but popping last element from stack, Integer to Number - Find pattern in each three digits of number also remember to handle edge cases
72nd - revised the concepts of OOPS - inheritance
73rd - Completed OOPS revision - Polymorphism , Getter and Setter, Static and Class methods
74th - Linked List - Insert,delete and display operations
75th - Double and circular Linked List - Insert and delete Operations
76th - NQueens1,NQueens2 - Traverse every row and add queen in 1 column and check.
77th - Word Break 1 and Word Break 2 - check each substring is present in dictionary or not
78th - Linked List reverse, binary to decimal conversion - use left shift(multiply by 2) and add 1
79th - Linked List Merge two sorted list, Delete a given node - Copy next node's value into it
80th - Linked list - fast and slow pointer method
81st - Linked list - Palindrome , reversing after middle
82nd - Linked List - intersection, switching heads to counter length variation
83rd - Linked List - Remove duplicates
84th - Linked List - Reverse Linked List 2 - reverse a part of linked list, Reorder Linked List
85th - Linked List - Remove nth node from end - move a pointer n times then start a prev pointer take care of edge cases
86th - Linked List - Cycle 2 - floyd's algorithm - find relationship between distance moved by both slow and fast pointer
87th - Linked List - Flatten a Multilevel Doubly Linked List - take care of the case when last element has a child
88th - Linked List - Rotate a linked list
89th - Linked List - Rotate k Groups - do 1st rotation outside while loop then do rest
90th - Stack - Concepts
91st - Nearest greater to left, Online stock span - whenever nested loops are there and inner loop(j) depends on outer loop(i) a better solution can be implemented using stack
92nd - Maximum Area in Histogram - think of finding Nearest smallest from left then from right as well
93rd - Maximum Area In Binary Matrix - think of compressing the 2D matrix into 1D, do not buildings need a ground to stand on ;)
94th - Water Trapping Problem - For each building find its left and right max, then think how much water will be above this building , Min Stack - using supporting stack and 2x-ME method
95th - Heap - insertion and deletion and heapify method - use heap when sorting needed and K is given it reduces time complexity to nO(logk)
96th - Heapq package in python, Kth smallest and largest element, K elements close to x
97th - Heap - Frequency Sort, kClosest points to the origin
98th - Minimum Cost to Merge Stones - Greedy solution done but not optimized :/ ->Need to think differently now
99th - Failed attempt to understand above ques DP solution will look again after sometime with fresh outlook. Sliding window concepts
100th - Sliding Window Maximum - for current element, if this element is greater than back of queue then keep on popping elements. All elements after this should be added to queue
101th - Count of occurence of anagrams - use sliding map, make second string as hashmap, then slide a window and if all characters in hashmap is zero then anangram found else not.

Challenge completed

Day counting stopped ,now this would be tracker for all ques i do

Longest substring without Repeating characters - instead of storing each character count better method would be to store index and to check that index lies between left and right pointers
Longest substring with at least k repeating characters - tried 2 methods now trying to understand the sliding window approach, for D&C - take char which are less than k and then partition string based on this.
  • Used sliding window for this here it is - first find the total number of unique characters then loop over the string and find the max substring with only the curr no. of unique characters and each time update the max variable
Subarray with k different integers - find all subarrays with atmost k integers and k-1 integers then subtract them to find our ans

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages