Everyone started leaving for home, hostel without friends is kinda depressing place, Shanti rehti hai fir bhi kisi cheez ko krne ka Mann nhi krta, but today's breakfast was good
So recently many seniors of my college are doing their final batch photoshoot and all.After approx 1 year, our batch will also leave the college. Time passed quickly since joining in 2021. Currently, my 5th semester just ended..
Another peak ECE moment
Wireless communication ka paper itna tough aaya Aaj ki koi pass nhi ho rha clearly, getting even 10/40 was so tough in this paper
One thing I have realized during this intern season is that the number of questions solved on LeetCode or any other platform doesn't matter. What truly matters is the ability to tackle new problems and having good logical and thinking skills.
LC daily:July 16(indeed hard)
Each line explained
We use Bitmasks (as C<=16) to represent the skills of each person and required skill then do a DP 0/1Knapsack.The goal is to find min number of people required to collectively possess all required skills
LC daily: 26 July
Similar Qn
"Each line explained in code"
Why binary search on answer range here?
Because we have a range of speeds [1,10^7] ,instead of trying every speed, we do BS on it, find valid speed ,store it and try to find more smaller
and only 6th semester is left, as last 2 semesters are mostly occupied by placements, and also most students will go to their home. These are the last few days, filled with expectations, excitement regrets and unspoken sentiments. It may sound quite early but it is what it is.
LC daily:22 July
Similar Questions
Each line explained
Intuition:Standard DFS+DP problem,where we go to first 8 possible places from current index,and then move to another 8 indexes for each index from them and keep storing the result till k become 0
LC daily: 19 July
Template for "Overlapping Interval Problem"+
Similar Qn+Line by line explanation
Intuition: Simply see how many intervals are overlapping (like [5,8] and [7,9] are , but [4,6] and [8,9] don't) ,use standard merge intervals method
LC daily:30 July
Similar Qn (must do)
"Each line explained"
This is special category of DP questions, mainly MCM type partition DP , we do partition in a interval [i,j] and keep min/max of results of subInterval.
AC link
remove box
LC daily: 14 July
Similar Qn+easy approach,well commented code
Intuition:Consider every element as the last element of an AP. Find if 'arr[i]-d' exists,if yes increase the size of this chain by 1,else starts new chain with size 1,take max at each point
LC daily:20 July
Similar Questions
Easy approach explanation
Line by line
Intuition:Asteroids meet only when a negative comes after positive. To maintain order use stack ,if +ve push it, if -ve then compare with top and take steps(more details in code)
LC daily: 12 July Similar question+2 lucid explanation line by line
1)Topo sort (BFS)- Topo sort only has (DAG) nodes
If a node is indulged in cycle ->It's not terminal and safe node while other nodes are safe
In topo vector we have only non cyclic nodes
LC daily: 25 July
Similar Qn
Each line explained
Why do binary search here?
Because question clearly states us to search in logN time
Approach:Use standard binary search and return when arr[i - 1] < arr[i] > arr[i + 1]
else change low and high limits
LC daily: 2 august
"Each line explained."
This problem is a classic example of where backtracking is an effective approach for generating all permutations.
Backtracking approach(easy)
LC daily: 17 July parent Qn+ easy approach explanation+
Line by line
Intuition:It is similar to Add Numbers I (add from start) but here we keep adding from end
So we reverse the linked lists and do Add Numbers I. In the end, we return it after reversing.
Hats off to my foolishness and punctuality .
I was going home...
From college to station the autorickshaw was charging 150,walked some distance to reach a nearby crossroad (100m) ,took an autorickshaw for 30 only (120 saved :))
1/2
LC daily:6 Aug(hard)
"Easiest Explanation,Each line Explained"
Intuition-At any position, we have 2 choices
1)Pick a song that is already used ( remember condition)
2)Pick a song that has not been used yet.
Write a recursive relation,then memoize it
AC