October 31
- rest day. happy diwali.
- Did get hacked on q2 of last biweekly ;-; but learnt an important lesson. Never use hashmaps over vectors unless it's absolutely required :(
October 30
- Solved: LC 1671. This was honestly a medium DP question. Doing it in reverse did make it a lot simpler.
- Upsolved: ABC 375 Spiral Matrix. Cool implementation for iterating through each layer. Learnt from aryanc403
for (int i = 0; i < n / 2; i++) {
int cnt = (i + 1) % 4;
for (int t = i; t < n - i; t++) {
v[i][t] = cnt; // marks (0,1)
v[t][i] = cnt; // marks (1,0)
v[n-1-i][t] = cnt; // marks diagonally opposite
v[t][n-1-i]= cnt; //marks diagonally opposite
}
}
October 29
- Solved: LC 2684
- Reimplementing stuff is so not fun ugh, commit: GrubGuidedb18a16
- I think after I finish the CRUD part of this, I'll just take a break from webd.
October 28
- Solved: LC 2501
- Wrote some code for my webd project: 15e3f6c
- Attempted CF Edu 171. Got tilted after I couldn't get the first question but i persevered and well able to reach pupil perf lol. Could only solve 2 tho.
- Blogs Read:
- Speeding up the insertion of a sorted (or mostly-sorted) key list into a std::map or other ordered associative container
So turns out you can supply hints and get amortized O(1) insertion into map!
- Speeding up the insertion of a sorted (or mostly-sorted) key list into a std::map or other ordered associative container
map.try_emplace(map.end(), v.key, v.value);
map.try_emplace(map.begin(), v.key, v.value);
October 27
- Visited my Dad's village today for a wedding so not much done.
- Solved: LC 1277
October 26
Solved 3 out of 4 in today's LC Biweekly! 2.7k rank. Stared at problem 2 for like 45 mins until idea hit and was solve fast. Problem 3 was nice and simple DP. Good confidence booster.
Also I'm setting up auto commit cronjobs for all of my important repos cause I'm scared of another formatting error ;-;
October 25
Traveled to home so nothing done. Reached safely π
- nvm solved LC daily: LC: 1223
October 24
- Went to lab in the morning, got 5G. Finished setting up my laptop. I genuinely forgot how much work there is to be done to set up. Atleast I had my dotfiles setup so that saved a ton work.
- On a more
positivenegative note, now my LAN and hotspot issues are still not working so I gave up started using my data as hotspot. ;-;
October 23
- bruh spent most of the day just installing my OS. Note to myself, please double check the boot media before trying to install ;-;
- On a more positive note, now my LAN and hotspot issues are fixed so that's a plus.
October 22
- It's 3:45 right now. Couldn't sleep lol. But fixed the failing tests in for my Picard PR πͺ.
commit: c82f01c - Good LC blog: General principles behind problems similar to "Reverse Pairs"
- Solved LC: 493
- Solved LC: 2583
To traverse a tree level order, just keep track of the queue size before you start and only run it for that many iterations.
queue<TreeNode*> q;
q.push(root);
while(!q.empty()) {
int size = q.size();
long long sum = 0;
while(size) {
TreeNode* temp = q.front();
q.pop();
if (temp->left) {
q.push(temp->left);
}
if (temp->right) {
q.push(temp->right);
}
size--;
}
}
October 21
Tough day ngl. When you try to help someone and mess up yourself ugh. Should've just made excuse and not go tbh.
Had Sparkplug as well which was ok ok. Prolly not good enough for second round. It's fine today I sleep early, tomorrow will be a good day!
October 20
- Solved LC: 219 just to keep the streak going.
- Today's CF contest (CF980) went bad.Could only solve one and well that killed all motivation I had for the day.
- Slept and recovered some energy. Made some commits according to phw's comments on my PR. cf267f6 47a139c d543ec0
Ending the day with a win!
October 19
- Solved LC: 56. Finally getting some confidence with interval type questions.
- Also finally averaging 100wpm on MonkeyType 60seconds. Never thought the day would come so really proud of it heh
- Made my first PR to picard! PICARD-2607: Add a β_genreβ variable #2545
- Solved 3 in Codeforces Round 979 Div 2. Rank was around 4k. Should've solved C much faster.
SpecialistAlmost Specialist perf tho (1398).
October 18
- Solved LC: 2044
- Solved GFG: Missing And Repeating
- Solved GFG: Largest subarray with 0 sum
- Solved GFG: Count Inversions. Really need to revise how to write quicksort and mergesort ;=;
October 17
- Solved LC: 670
- Solved LC: 1021
- Learnt about np.concat and searching and comparing using np array. Numpy is actually taking some time to get used to ngl.
- Solved GFG Longest Sub-Array with Sum K
- Solved GFG Maximum Score from Subarray Minimums
Just trying to finish up Striver sheet.
October 16
- Participated in Starters 156B, solved 2. Added next 2 for upsolve.
- Solved LC: 1405
- Made my first addon! It's a small one but pretty useful as it just displays the attendance percentage. I genuinely don't know why it's not already a feature.
GitHub Repo
October 15
- Went through Array Indexing and Slicing using Numpy.
- Solved LC: 2938
- Making my own sandbox for cybersec viva using ulimit, chroot and MALLOC_SIZE env var.
October 14
- Solved LC: 2530
- Upsolved Replace With First from Starters 155
- Upsolved D - ABA from Atcoder ABC 375
- Gave CF Edu 170, Solved 3/7. Perf: 1259. Should've solved B and C faster.
- Learnt basics of Numpy, np.shape, np.arange etc.
October 13
- Solved LC: 632
- Updated resume.
- Wasted around 2 hours on installing CUDA ;-;
October 12
- Solved LC: 2046
- Gave both Atcoder ABC375 (solved 2/6) and LC Biweekly 141(solved 2/4)
- Learnt about file handling in Python and with that wrapped up Intro to Python course. Was a nice refresher and I'm looking forward to learn Numpy.
- Wrote the schema for order table and added support in the frontend.