Dated: 1 July 2023
I am college student and my 3rd year is about to start from the next month. Currently my semester breaks are going now and lately, like from since starting of the 2nd year, I have inclined towards earning money, mainly because I want to be able to take the burden off my parents about the college fees. I have taken several steps to achieve that, I have actively applied to over, I don't know, over 100 internships, got 2 interviews, landed 0 roles.
Then I started off preparing for GSoC'23, but couldn't make that possible. Frustrated, I had quit doing everything and was just watching movies and series for the entire June.
Now, I realize that I cannot stop, atleast not right now. Worst to worst I will have 200 more rejections, but there will always be that possibility of landing 1 role. That hope is all I need to get started again.
However, it's almost 3rd year now and I realize I need to work upon my DSA skills and so starting today I will be following Striver's DSA sheet to start working on improving my concepts. I am personally very scared of Dynamic programming, hence till the point I have time, I will be doing atleast one question of the same daily.
I have studied DSA earlier, but only the theory portion of it and hence, I will start doing and questions and learn whatever is left along the way.
I had originally started on 30th June, but it is today that I have decided to document my journey.
I wish myself best of luck and in case you, the reader, if you read uptill now, realize that I am irregular, please please just yell out something in the comments.
Enough of talk, here is what I did on:
DAY 0:
I solved 6 question from Striver's sheet today.
PROBLEM 1: Set matrix to 0:
I had figured out the solution to solve the problem with O(m + n) space complexity, by using array for marking which rows or columns I needed to change.
For the O(1) space complexity solution, I had to read it from the solution, but understood at once.
PROBLEM 2: Pascal's Triangle: Easy problem, solved it optimally in one go, also in the follow ups, we need to note how to calculate each element, nCr.
PROBLEM 3: Next Permutation: I thought of the solution, but could not materialize it. In short I had a vague idea but could not implement it.
Saw the solution, then was able to solve.
PROBLEM 4: Kadane Algo: I had solved it earlier also. Was able to solve in O(n3), in O(n2) and in O(n).
PROBLEM 5: Sort 0,1,2: Was able to solve optimally.
PROBLEM 6: Buy and Sell Stocks I: Was able to solve optimally.
Dynamic Programming
I solved the following introductory problems:
PROBLEM 1: Fibonacci Number
PROBLEM 2: No of ways to climb stairs
PROBLEM 3: Tribonacci Number
DAY 1:
Solved 6 questions of Striver's sheet today.
PROBLEM 1: Rotate matrix: Was not able to come up with a solution that was hard to implement, which required swapping elements three/ four/ n times per each square.
Then saw and understood and implemented the optimal solution which was to use transpose of the matrix.
PROBLEM 2: Merge overlapping intervals: Solved it optimally.
PROBLEM 3: Merge two sorted arrays without extra space: Solved it optimally.
PROBLEM 4: Find repeating element in N + 1 elements: The most optimal solution was with using Linked Lists. Didn't understand it completely, need to look at it again.
PROBLEM 5: Find missing number in N sequence: Solved it optimally.
PROBLEM 6: Count Inversions: Solved it optimally using Merge Sort. O(n*log(n)), also in O(n2) using 2 loops.
Dynamic Programming
Was able to solve only 1 problem, which was very hard for me, and I wasn't left with brains to solve another.
PROBLEM 1: Delete and Earn: Was able to write the recursive approach, but couldn't convert it to DP.
Looked up and implemented both memoization and tabular approach, but would definitely need to look at it again someday.
Thanks for reading this far.
That's it for the 1st two days.
Will be back tomorrow.
Top comments (0)