-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudyjournal.txt
More file actions
4469 lines (3457 loc) · 109 KB
/
Copy pathstudyjournal.txt
File metadata and controls
4469 lines (3457 loc) · 109 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#DATE: 3/02/2021 11:00 AM - 12:00 PM
Topic: Python syntax check
Resources:
- https://www.w3schools.com/python/
Completed till: https://www.w3schools.com/python/python_dictionaries_exercises.asp
#DATE: 4/02/2021 11:00 AM - 12:00PM
Topic: Python syntax check
Resources:
- Completed https://www.w3schools.com/python/
Topic: Variable naming and best practices:
Resources:
- Completed https://realpython.com/python-pep8/
TODO:
-Google styles for python: https://google.github.io/styleguide/pyguide.html
#DATE: 5/02/2021 11:00 AM - 12:00PM
Topic: Python best practices
Resources:
Google styles for python: https://google.github.io/styleguide/pyguide.html
How to use docstring to explain functions/modules:
GOOGLE EXAMPLE:
def fetch_smalltable_rows(table_handle: smalltable.Table,
keys: Sequence[Union[bytes, str]],
require_all_keys: bool = False,
) -> Mapping[bytes, Tuple[str]]:
"""Fetches rows from a Smalltable.
Retrieves rows pertaining to the given keys from the Table instance
represented by table_handle. String keys will be UTF-8 encoded.
Args:
table_handle: An open smalltable.Table instance.
keys: A sequence of strings representing the key of each table
row to fetch. String keys will be UTF-8 encoded.
require_all_keys: Optional; If require_all_keys is True only
rows with values set for all keys will be returned.
Returns:
A dict mapping keys to the corresponding table row data
fetched. Each row is represented as a tuple of strings. For
example:
{b'Serak': ('Rigel VII', 'Preparer'),
b'Zim': ('Irk', 'Invader'),
b'Lrrr': ('Omicron Persei 8', 'Emperor')}
Returned keys are always bytes. If a key from the keys argument is
missing from the dictionary, then that row was not found in the
table (and require_all_keys must have been False).
Raises:
IOError: An error occurred accessing the smalltable.
"""
**Come back to Google best practices again in April
Resources:
Summary of best practices on python : https://gist.github.com/sloria/7001839
#DATE: 08/02/21 6:30 PM - 7:30PM
Topic: C++ Syntax
Resources:
- Completed till Chapter 10: Storage Classes
https://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf
Topic: C++ Best practices
Resources:
http://web.mit.edu/6.s096/www/standards.html
TODO:
- Finish C++ Syntax:
https://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf
- Reference for simple C++:
https://www.tutorialspoint.com/cplusplus/pdf/cpp_basic_syntax.pdf
#DATE: 09/02/21 11:00 AM - 12:00PM
Topic: C++ Syntax
- Completed
https://www.tutorialspoint.com/cplusplus/cpp_tutorial.pdf
https://www.tutorialspoint.com/cplusplus/pdf/cpp_basic_syntax.pdf
Topic: C++ STL
Resources:
https://www.geeksforgeeks.org/cpp-stl-tutorial/
https://www.tutorialspoint.com/cplusplus/cpp_stl_tutorial.htm
Text Book:
https://www.cppreference.com/Cpp_STL_ReferenceManual.pdf
Important STL Algorithms:
https://www.geeksforgeeks.org/c-magicians-stl-algorithms/
STL INTRODUCTION:
- Completed till Algorithms
https://www.geeksforgeeks.org/the-c-standard-template-library-stl/
TODO:
Complete:
1. https://www.geeksforgeeks.org/the-c-standard-template-library-stl/
2. https://www.geeksforgeeks.org/cpp-stl-tutorial/
#DATE: 10/02/21 10:30 AM - 11:30 AM
Topic: C++ STL
- Completed Containers
https://www.geeksforgeeks.org/the-c-standard-template-library-stl/
TODO:
Complete:
1. https://www.geeksforgeeks.org/the-c-standard-template-library-stl/
2. https://www.geeksforgeeks.org/cpp-stl-tutorial/
#DATE 11/02/21 11:10 AM - 12:10PM
Topic: C++ STL
Resources:
-Completed https://www.geeksforgeeks.org/the-c-standard-template-library-stl/
Topic: C++ Best Practices
Resources:
- Completed https://isocpp.org/wiki/faq/coding-standards
TODO:
C++ Core Guidelines: http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
**********************************************************************
C++ Best Practices (VERY IMPORTANT, Complete the whole chapter):
https://lefticus.gitbooks.io/cpp-best-practices/content/03-Style.html
**********************************************************************
#DATE 12/02/21 11:05 AM - 12:05 PM
Topic: C++ Best Practices
Resources:
- Completed https://lefticus.gitbooks.io/cpp-best-practices/content/03-Style.html
- 00:29:00 https://www.youtube.com/watch?v=qH6sSOr-yk8&ab_channel=PauloPortela
TODO:
Watch when bored: https://www.youtube.com/watch?v=qH6sSOr-yk8&ab_channel=PauloPortela
TODO:
Watch:
1. https://www.youtube.com/watch?v=2olsGf6JIkU&ab_channel=CppCon
DATE: 18/02/2021 10:50 AM- 11:50 AM
Topic: Array
Resources:
GFG: https://practice.geeksforgeeks.org/explore/?category%5B%5D=Arrays&page=1&category%5B%5D=Arrays
Problems:
1. Largest Element in Array
2. Game with nos
3. C++ Arrays (Sum of array) | Set 1
4. Play With OR
5. Cyclically rotate an array by one
6. Find minimum and maximum element in an array
7. Display longest name
TODO DONE:
Rotate Array
#DATE: 19/02/2021 11:00 AM - 12:00 PM
Topic: Array
Problems:
1. Rotate Array
Study this: https://www.geeksforgeeks.org/array-rotation/
2. Product of maximum in first array and minimum in second
3. Nuts and Bolts Problem (DO THIS WITHOUT MAP)
#DATE 22/02/2021 11:35 AM - 12:05 PM
Topic: Array
Problems:
1. Wave Array
2. Multiply left and right array sum
3. Balanced Array
4. Maximum in Struct Array
5. Fighting the darkness
6. Count the Zeros (Binary search for 0 which has a 1 on it's left side)
#DATE 23/02/2021 11:00 AM - 12:00 PM
Topic: Array
Problems:
1. Form a number divisible by 3 using array digits
Involves mathematics where the sum of digits in a number must be divisible by 3 for
it to be divisible by 3
2. Segregate 0s and 1s
3. Sort an array of 0s, 1s and 2s
Concept of low , mid, high
These are the following steps:
Maintain 3 variables low, high and mid
low - all elements before low are 0
mid - all elements between low and mid are 1
high - all elements after high are 2
Initially low, mid are set at 0 and high is at n-1
Now, we iterate mid from 0 to high, and for every element
if it is equal to 0, we swap it with element at low, and increment low and mid
else if it is equal to 2, we swap it with element at high, and decrement high
else we just increment mid (i.e element is equal to 1)
4. Length of longest subarray
TODO DONE:
Index Of an Extra Element
#DATE 24/02/2021 11:00 AM - 12:00 PM
Topic: Array
Problems:
1. Index Of an Extra Element
If mids are same, elements till that index are sorted, hence check for elements on the right
2. Replace all 0's with 5
3. Find Number of Numbers
4. Kadane's Algorithm
Algorithm:
Initialize:
max_so_far = a[0]
max_ending_here = a[0]
Do:
-> Go through loop
-> Check if current_max = max(a[i],current_max+a[i])
-> Check if overall_max = max(current_max,overall_max)
return overall_max
TODO:
Learn METHOD 3 (A Juggling Algorithm)
https://www.geeksforgeeks.org/array-rotation/
#DATE 25/02/2021 11:05 AM - 12:05 PM
Topic: Array
Problems:
1. Ishaan Loves Chocolates
2. Find Transition Point
3. Three way partitioning
If any problem says partition in 3 ways, remember how to partition 0,1,2 it will always be the same logic
4. Implement 2 stacks in an array
#DATE 26/02/2021 11:05 AM - 12:05 PM
Topic: Array
Problems:
1. Subarrays with equal 1s and 0s
2. Subarrays with sum 0
Algorithm:
+ Make hashmap of <int,vector<int>>
+ Make a vector of pairs vector<pair<int,int>>
+ Calculate sum at each index,
- If sum is 0, then the subarray from 0 to i, it's sum is 0
- If sum is already in the map, then it means everyelement pair of (map[sum]+1,i) is 0
+ add the element to the map of the sum map[sum].push_back(i)
DO NOT FIND THE VECTOR IF YOU JUST WANT TO RETURN NUMBER OF SUB ARRAYS
3. Equilibrium index of an array
int findEquilibrium(int arr[], int n)
{
//Your code here
int lsum =0;
int rsum=0;
int crsum;
int equilibrium_point = -1;
for(int it=0;it<n;++it){
rsum += arr[it];
}
// cout<<"lsum: "<<lsum<<", rsum:"<<rsum<<endl;
for(int it=0;it<n;++it){
crsum = rsum - (lsum+arr[it]);
// cout<<"lsum: "<<lsum<<", crsum:"<<crsum<<endl;
if(lsum == crsum){
equilibrium_point = it;
}
lsum += arr[it];
}
return equilibrium_point;
}
#DATE 01/03/2021 11:05 AM - 12:05 PM
Topic: Array
Problems:
TODO: Rearrange an array with O(1) extra space
Topic: Stacks/Queues
Problems:
1. Queue Reversal
2. Reverse First K elements of Queue
3. Reverse a string using Stack
4. Stack designer
5. Get min at pop (compare at each step and push the min)
TODO:
Sort a stack in C++
#DATE 02/03/2021 11:15 AM - 12:15 PM
Topic: Stacks/Queues
Problems:
1. Next Greater Element
vector<long long> nextLargerElement(vector<long long> arr, int n){
// Your code here
stack<long long> s;
vector<long long> output;
for(auto it=arr.rbegin();it!=arr.rend();++it){
if(s.empty()){
output.push_back(-1);
s.push(*it);
}
else{
while(!s.empty() && *it>s.top()){
s.pop();
}
if(s.empty()){
output.push_back(-1);
s.push(*it);
}
else{
output.push_back(s.top());
s.push(*it);
}
}
}
reverse(output.begin(),output.end());
return output;
}
#DATE 03/03/2021 11:00 AM - 12:00 PM
Topic: Stacks/Queues
Problems:
1. Remove repeated digits in a given number
2. Generate Binary Numbers
3. Smallest number on left (Same as next higher number)
4. Reverse each word in a given string (Use stacks in C++)
#DATE 05/03/2021 11:00 AM - 12:00 PM
Topic: Stack/Queues
Problems:
1. Min sum formed by digits
2. Ticket Counter
3. GeeksforGeeks
4. Queue using stack
#DATE 06/03/2021
Problems:
1. Pairwise Consecutive Elements
2. Check if two arrays are equal or not
3. Non-Repeating Element
#DATE 07/03/2021
Problems:
1. Second most repeated string in a sequence
#DATE 08/03/2021 11:00 AM - 12:00 PM
Topic: Maps
Problems:
1. Print Anagrams Together
2. Check if a string is Isogram or not
3. Minimum indexed character
4. Twice Counter
5. Subarray with 0 sum
#DATE 09/03/2021 11:00 AM - 12:00 PM
Topic: Maps
Problems:
1. Smallest number repeating K times
2. Largest subarray with 0 sum
3. Remove duplicates in small prime array
4. Sum Indexes
5. Count pair sum
6. Count pairs with given sum
# DATE 10/03/2021 11:10 AM - 12:10 PM
Topic: Maps
Problems:
1. Grouping values
# DATE 11/03/2021 11:10 AM - 12:10 PM
Topic: Maps
Problems:
1. Match specific pattern
2. Max distance between same elements / Maximum number of characters between any two same character
# DATE 12/03/2021 11:10 AM - 12:10 PM
Topic: Maps
Problems:
1. Completing tasks
2. Array Subset of another array
TODO: HEAPS - Maximum distinct elements after removing K elements
#DATE 15/03/2021 10:50 AM - 12:00 PM
Topic: Trees
Problems:
1. Inorder Traversal (Iterative)
2. Inorder Traversal (Recursive)
3. Preorder traversal (Iterative)
4. Preorder traversal (Recursive)
#DATE 16/03/2021 10:50 AM - 12:00 PM
Topic: Trees
Problems:
1. Postorder Traversal (Recursive)
2. Level order traversal (BFS)
3. Postorder Traversal (Iterative)
4. Height of Binary Tree
5. Mirror Tree ( Can use inorder traveral with stack or
void mirror(Node* node)
{
// code here
if(node == NULL){
return;
}
mirror(node->left);
mirror(node->right);
swap(node->left, node->right);
}
)
6. Count Leaves in Binary Tree
7. Minimum element in BST
8. Size of Binary Tree
#DATE 17/03/2021
Topic: Trees
Problems:
1. K distance from root
2. Sum of Binary Tree
3. Sum of Leaf Nodes
4. Odd even level difference
5. Max Level Sum in Binary Tree
6. Minimum Depth of a Binary Tree
#DATE 18/03/2021 11:00 AM - 12:00 PM
Topic: Trees
Problems:
1. Vertical sum
2. Root to leaf paths sum
3. Number of root to leaf paths
#DATE 19/03/2021 11:10 AM - 12:10 PM
Topic: Trees
Problems:
1. Children Sum Parent
2. Remove Half Nodes
# DATE 22/03/2021 11:10 AM - 12:10 PM
Topic: Sorting
Problems:
1. Sort an array of 0s, 1s and 2s
2. Maximum Possible Sum of Products
3. Floor in a Sorted Array
THEORY: https://www.interviewbit.com/tutorial/sorting-algorithms/
Bubble Sort
Insertion Sort
Quick Sort - 22/03/2021
Merge Sort
Heap Sort
# DATE 23/03/2021 11:10 AM - 12:10 PM
Topic: Sorting
Problems:
1. Maximum product of two numbers
2. Sort in specific order
3. Alternative Sorting
4. Sorting Elements of an Array by Frequency
5. Minimize sum of alternate product
# DATE 25/03/2021 11:00 AM - 12:00 PM
Topic: Sorting
Problems:
1. Fitting The Array
2. Triplet Family
3. Sorting all array elements except one
4. Rope Cutting ( Sort and if the difference is greater than 0, then from that point till end will be an entry
and make this number as the new minimum. This is only true when sorted)
#DATE 26/03/2021 11:05 AM - 12:05 PM
Topic: Sorting
Problems:
1. Two numbers with sum closest to zero
** DYNAMIC PROGRAMMING **
Aditya Verma: https://www.youtube.com/c/AdityaVermaTheProgrammingLord/playlists
Back to Back SWE: https://www.youtube.com/c/BackToBackSWE/playlists
Steps to solve a DP:
1) Identify if it is a DP problem
2) Decide a state expression with
least parameters
3) Formulate state relationship
4) Do tabulation (or add memoization)
#DATE 27/03/2021
Problems:
1. Search in a row-column sorted Matrix
2. Parenthesis Checker
3. Sorting Elements of an Array by Frequency
4. Minimum Distinct Ids
5. First Repeating Element
Variations:
1. 0-1 Knapsack problem (6)
- Subset Sum
- Equal Sum Partition
- Count Of Subset Sum
- Minimum Subset Sum Difference
- Target Sum
- Number Of Subset With Given Difference
2. unbounded Knapsack problem (5)
3. Fibonacci (7)
4. LCS (15)
5. LIS (10)
6. Kadane's algorithms (6)
7. Matrix Chain Multiplication (7) **IMPORTANT
8. DP on Trees (4)
9. DP on Grid (14)
10. Others (5)
#DATE 29/03/2021
Topic: Dynamic Programming
Steps to solve a DP:
1) Identify if it is a DP problem
2) Decide a state expression with
least parameters
3) Formulate state relationship
4) Do tabulation (or add memoization)
To accept inputs till EOF:
1. while(!cin.eof())
2. while(cin>>input)
Resource for DP: https://www.youtube.com/c/AdityaVermaTheProgrammingLord/playlists
Types of DP (PARENT PROBLEMS - For Variations):
1. 0-1 Knapsack problem (6)
2. unbounded Knapsack problem (5)
3. Fibonacci (7)
4. LCS (15)
5. LIS (10)
6. Kadane's algorithms (6)
7. Matrix Chain Multiplication (7) **IMPORTANT
8. DP on Trees (4)
9. DP on Grid (14)
10. Others (5)
Variations:
1. 0-1 Knapsack problem (6)
1 Subset Sum
2 Equal Sum Partition
3 Count Of Subset Sum
4 Minimum Subset Sum Difference
5 Target Sum
6 Number Of Subset With Given Difference
2. unbounded Knapsack problem (5)
1 Rod Cutting
2 Coin Change I (Maximum number of ways)
3 Coin Change II (Minimum number of Coins)
4 Maximum Ribbon Cut
3. Fibonacci (7)
4. LCS (15)
1 Longest Common Substring (LC-substring)
2 Print LCS
3 Shortest Common Supersequence (SCS)
4 Print SCS
5 Minimum number of insertions and deletions from a->b (Edit distance)
6 Longest Repeating Subsequence
7 Length of longest Subsequence of which is a substring in b
8 Subsequence pattern matching
9 Count how many times a appears as Subsequence in b
10 Longest Palindromic Subsequence
11 Longest Palindromic Substring
12 Count of Palindromic substring
13 minimum number of deletions to make it a Palindrome
14 minimum number of insertions to make it a Palindrome
5. LIS (10)
6. Kadane's algorithms (6)
7. Matrix Chain Multiplication (7) **IMPORTANT
8. DP on Trees (4)
9. DP on Grid (14)
10. Others (5)
Problems:
1. Bytelandian gold coins (memoization)
2. 0-1 Knapsack Problem (Recursive)
3. 0 - 1 Knapsack Problem (memoization)
#DATE 30/03/2021 11:00 AM - 12:00 PM
Topic: Dynamic Programming
Problem:
1. 0 - 1 Knapsack Problem (Bottom-Up)
#DATE 31/03/2021 11:00 AM - 12:00 PM
Topic: Dynamic Programming
Problems:
1. Subset Sum Problem (Recursive)
2. Subset Sum Problem (Bottom Up)
#DATE 01/04/2021 11:00 AM - 12:00 PM
Topic: Dynamic Programming
Problems:
1. Partition Equal Subset Sum (Bottom Up from subset sum)
2. 1. Two Sum (Leet code)
#DATE 02/04/2021 11:00 AM - 12:00 PM
Topic: Dynamic Programming
Problems:
1. Count of subset sum (Bottom Up)
2. 1498. Number of Subsequences That Satisfy the Given Sum Condition
3. 7. Reverse Integer
#DATE 03/04/2021
Topic: Dynamic Programming
Problems:
1. 72. Edit Distance (Hard)
2. Minimum sum partition (Hard)
3. 698. Partition to K Equal Sum Subsets (Medium)
4. 300. Longest Increasing Subsequence (Medium)
5. 674. Longest Continuous Increasing Subsequence
#DATE 04/04/2021
Topic: Dynamic Programming
1. Count number of subsets with a given difference
2. 494. Target Sum (Same as above) (Medium)
changes --> consider 0's
count the number of zeros
if a zero appears while calculating, do not consider it as we will add them later on
at the end multiply the answer by 2^count to include the permutations possible with 0 added
3. Unbounded Knapsack (It is 0-1 Knapsack where if you have a choice to take, you can take again t[i-1]->t[i])
4. Rod Cutting
5. Coin Change (Maximum number of ways)
6. 322. Coin Change (Minimum number of ways)
7. Maximise The Cut Segments (Same as 322. coin change)
#DATE 05/04/2021 11:00 AM - 12:00 PM
Topic: Dynamic Programming
Problems:
1. 1143. Longest Common Subsequence (Recursive)
2. 1143. Longest Common Subsequence (Bottom-up DP)
#DATE 06/04/2021 11:00 AM - 12:00 PM
Topic: Dynamic Programming
Problems:
1. Longest Common Substring
2. Printing LCS
#DATE 07/04/2021 11:00 AM - 12:00 PM
Topic: Dynamic Programming
Problems:
1. Shortest Common Super sequence
2. 583. Delete Operation for Two Strings | 25 Minimum Number of Insertion and Deletion to convert String a to String b
3. 516. Longest Palindromic Subsequence
#DATE 08/04/2021
Topic: Dynamic Programming
Problems:
1. Minimum Deletions | 28 Minimum number of deletion in a string to make it a palindrome
2. 1092. Shortest Common Supersequence
3. 1312. Minimum Insertion Steps to Make a String Palindrome
4. 30 Longest Repeating Subsequence
5. 392. Is Subsequence
#DATE 09/04/2021
Topic: Dynamic Programming on Trees
1. Diameter of a Binary Tree
2. Maximum path sum from any node to any
3. Maximum path sum from leaf to leaf
4. Diameter N-ary Tree
Problems:
1. 543. Diameter of Binary Tree
2. 124. Binary Tree Maximum Path Sum
TODO: Find the maximum path sum between two leaves of a binary tree
#DATE 12/04/2021
Topic: Heaps
Problems:
1. 215. Kth Largest Element in an Array
2. Kth smallest element
3. Nearly Sorted Algorithm / K Sorted Array
4. 658. Find K Closest Elements (Using multimap{296 ms, faster than 5.27% | 48.7 MB, less than 6.64%} | Heaps)
#DATE 13/04/2021
Topic: Heaps
Problems:
1. 347. Top K Frequent Elements
2. 451. Sort Characters By Frequency
3. 9. Palindrome Number
4. 100. Same Tree
5. 973. K Closest Points to Origin
6. Minimum Cost of ropes
#DATE 14/04/2021 11:00 AM - 12:00 PM
Topic: Binary Search
Problems:
1. 704. Binary Search
2. 34. Find First and Last Position of Element in Sorted Array
3. Number of occurrence
#Date 15/04/2021 11:00 AM - 12:00 PM
Topic: Binary Search
Problems:
1. 153. Find Minimum in Rotated Sorted Array
2. 33. Search in Rotated Sorted Array
#DATE 16/04/2021 11:00 AM - 12:00 PM
Topic: Binary Search
Problems:
1. Floor in a Sorted Array
2. Ceil of an element in a Sorted Array
3. 744. Find Smallest Letter Greater Than Target
#DATE 17/04/2021
Topic: Leetcode
Problems:
1. 26. Remove Duplicates from Sorted Array
2. 53. Maximum Subarray
3. 35. Search Insert Position
4. 112. Path Sum
5. 169. Majority Element
6. 226. Invert Binary Tree
7. 242. Valid Anagram
8. 257. Binary Tree Paths
9. 235. Lowest Common Ancestor of a Binary Search Tree
10. 389. Find the Difference
11. 136. Single Number
12. 268. Missing Number
13. 287. Find the Duplicate Number
14. 387. First Unique Character in a String
15. 409. Longest Palindrome
16. 645. Set Mismatch
#DATE 18/04/2021
Topic: Leetcode
Problems:
1. 448. Find All Numbers Disappeared in an Array
2. 819. Most Common Word
3. Fibonacci Sequence
4. 1047. Remove All Adjacent Duplicates In String
#DATE 19/04/2021 11:00 AM - 12:00 PM
Topic: Binary Search
Problems:
1. 13 Find position of an element in an Infinite Sorted Array
2. 14 Index of First 1 in a Binary Sorted Infinite Array
3. 15 Minimum Difference Element in a Sorted Array
4. 1200. Minimum Absolute Difference (nlogn)
#DATE 20/04/2021 11:00 AM - 12:00 PM
Topic: Binary Search
Problems:
1. 162. Find Peak Element
2. 852. Peak Index in a Mountain Array
3. 18 Find maximum element in Bitonic Array (Same as 162. Find Peak Element)
4. 19 Search An Element in Bitonic Array (Same as Find maximum element in Bitonic Array with BS from [0,max) or (max,n-1])
You are dividing the array into two and checking which area this might be in and applying BS on that part.
5. 104. Maximum Depth of Binary Tree
6. 20. Valid Parentheses
#DATE 21/04/2021 11:00 AM - 12:00 PM
Topic: Binary Search
Problems:
1. Search in a matrix
TODO ON BINARY SEARCH:
Book Allocation Problem (GFG) (DONE)
Aggressive cow (spoj)
Prata and roti (spoj)
EKO (spoj)
Google kickstart A Q-3 2020
1482 Minimum Number of Days to Make m Bouquets (DONE)
1283 Find the Smallest Divisor Given a Threshold (DONE)
1231 Divide Chocolate (NEED SUBSCRIPTION)
875 Koko Eating Bananas (DONE)
774 Max Distance to Gas Station (NEED SUBSCRIPTION)
410 Split Array Largest Sum (DONE)
1011. Capacity To Ship Packages Within D Days (DONE)
https://www.geeksforgeeks.org/painters-partition-problem/
https://www.geeksforgeeks.org/allocate-minimum-number-pages/ (DONE)
#DATE 22/04/2021 11:00 AM - 12:00 PM
Topic: Binary Search
Problems:
1. Allocate minimum number of pages
2. 1011. Capacity To Ship Packages Within D Days
3. 1482. Minimum Number of Days to Make m Bouquets
4. 1283. Find the Smallest Divisor Given a Threshold
#DATE 23/04/2021 11:00 AM - 12:00 PM
Topic: Binary Search
Problems:
1. 875. Koko Eating Bananas
2. 410. Split Array Largest Sum
3. The Painter's Partition Problem
TODO ON STACKS:
1. Nearest Greater to Left
2. Nearest Greater to Right
3. Nearest Smaller to Left
4. Nearest Smaller to Right
5. Stock Span Problem
6. Maximum Area of Histogram
7. Max area of rectangle in Binary Matrix
8. Rain Water Trapping
9. Implementing a min stack (With extra space / Without extra space)
10. Implementing stack using Heap
11. The Celebrity Problem
12. Longest Valid parenthesis
13. Iterative Tower of Hanoi
#DATE 24/04/2021
Topic: Leetcode
Problems:
1. 66. Plus One
2. 283. Move Zeroes
3. 463. Island Perimeter
4. 500. Keyboard Row
5. 605. Can Place Flowers
#DATE 25/04/2021
Topic: Leetcode
Problems:
1. 575. Distribute Candies
2. 746. Min Cost Climbing Stairs
3. 724. Find Pivot Index
4. 70. Climbing Stairs
5. 771. Jewels and Stones
6. 896. Monotonic Array
7. 1051. Height Checker
8. 1550. Three Consecutive Odds
#DATE 26/04/2021 11:00 AM - 12:00 PM
Topic: Stacks
Problems:
1. Next Greater Element
2. 3 NGL | Nearest Greater to Left
#DATE 27/04/2021 11:00 AM - 12:00 PM
Topic: Stacks
Problems:
1. 4 NSL | NEAREST SMALLER TO LEFT
2. Stock span problem
#DATE 29/04/2021 11:00 AM - 12:00 PM
Topic: Stacks
Problems:
1. Maximum Rectangular Area in a Histogram (Get the values of left and right correctly while calculating area)
Same as 84. Largest Rectangle in Histogram (HARD)
#DATE 30/04/2021
Topic: Stacks
Problems:
1. 85. Maximal Rectangle (HARD)
2. 84. Largest Rectangle in Histogram (HARD)
3. 42. Trapping Rain Water (HARD) - (Store the maximum_left and maximum_right in arrays before starting calculations)