My best 5 KM run timing is currently 32:49
Putting social accountability on myself by posting it here.
I won't tweet anymore until I do a 5 KM run in under 30 minutes.
Wish me luck!
Got India Rank 1 in the Leetcode Weekly Contest today.
World Rank 32 out of 25,000+ folks,
Was able to solve all 4 problems in 21 minutes.
All Problems Intuitions -
Problem A - Check the count of set bits for each number. If equal to the given count, add to the answer.
Got India Rank 1 in the Leetcode Contest today.
World Rank 7 out of 28,000+ folks.
Was able to solve all 4 problems in 21 minutes.
All Problems Intuitions 🧵
Sam Altman ko Microsoft ka call aaya.
Sam - Yaar tum DSA bahut poochte ho, main nhi aayunga.
Microsoft - To sikh lo DSA.
Sam - I don't need you, you need me. Hum kyon badlein apne aap ko.
Microsoft - Thik h aa jao, nhi puchenge DSA.
Sam - Jitna AI puchoge bta denge, but
I have interviewed 50+ Candidates at Google.
From my personal experience, below are major things that many folks can improve about how to approach an algorithmic interview.
Here is a detailed thread🧵...
Ask me anything about Competitive Programming, DSA, or Tech-Life in general.
Will try to answer everything that I am able to share and also reasonably confident in.
About me - I am an IIT Kgp grad, I worked for 3 years with Tower Research Capital, and then for 3+ years now at
Got India Rank 1 in Codechef Round Today.
World Rank 4.
Problem Intuitions -
Problem Dull Operation - Make the OR as N and XOR as 1. a = N, b = N - 1 will do this.
Problem Spooky Sequences - Find connected components. In each connected component, order is fixed except for
This month, I completed my 3 years at Google.
I will try to write my learnings and experiences in a detailed tweet thread soon.
P.S. I joined Twitter a couple of weeks ago. I intend to regularly share things about software development, data structures, algorithms, etc.
Mathematics is one of the most ignored topics in Competitive Programming.
I have seen many folks being very weak in this topic.
Try CSES maths problems set to test and improve your maths skills.
It covers some of the common fundamental techniques.
Starting 15 problems is very
We Indians are funny people.
We will boo the hell out of Hardik Pandya for changing the IPL team.
But won't care at all when politicians keep switching parties, going back and forth multiple times.
Because opponent had never lost a single international match before this, not even one out of 70-80 matches.
Won last olympic gold without conceding a point, not even a single freaking point.
I am among the top 0.06% of users globally in Leetcode Contests.
This is my recommended strategy beginners can use to start and practice with Leetcode for the purpose of clearing algorithmic interviews.
Here is a detailed thread 🧵...
Even Sam Altman can get removed and looks like they don't "need" him anymore.
Then there is some influencer who says Microsoft "needed" me, I didn't need Microsoft.
One of the best set of problems for beginners to practice and improve is this one. Make your sorting and searching section in CSES look like this, you have learnt lots of new things.
This problem section covers the most common topics to start with searching and sorting.
Unlike
I have Master title on the Codefoces with a rating of 2200.
According to me, This is the most important thing for starting with competitive programming for beginners.
A detailed thread on how to get started with CP 🧵
I got India Rank 1 in the last Leetcode contest.
Giving contests is super fun and thrilling but a significant chunk of learning happens in the upsolving after the contest.
Here is a detailed 🧵on my recommendation on what should be the method to upsolve for maximizing learning
Ask me anything about Competitive Programming, DSA, or Tech-Life in general.
Will try to answer everything that I am able to share and also reasonably confident in.
About me - I am an IIT Kgp grad, I worked for 3 years with Tower Research Capital, and then for 3+ years now at
If you struggle with dynamic programming, make your CSES dynamic programming problem section look like this.
This problem section covers most of the topics and common techniques.
Unlike a few other sections of CSES, most in this section are beginner-friendly.
Find the problem
Competitive programming is like sex: once in a while it may give practical results like helping in clearing job interviews, but that's not why we do it.
Me neither.
I have given DSA rounds of
- Google
- Tower Research Capital
- Linkedin
- Directi (Medianet)
- Intuit
When I started learning DSA, there were no such useful channels.
So I am gonna give more credit to myself here for never failing one DSA round :D
Reached 2800+ rating in Leetcode contests.
In the Top 0.05% of the world.
Sharing some tips about performing better in contests -
- Think of special cases - edge cases. Let's say a binary string is there and something needs to be calculated on that. Think of a string with all
Sharing some super-useful resources for blogs for learning DSA and Competitive Programming.
I have learned a lot of things from many of these personally.
Here is a 🧵
Leetcode Contest 367
India Rank 3 and World Rank 35.
All Problems Intuitions -
Problem A - Check all pairs of indices, take any pair which satisfies.
Problem B - Length is 100 only, count for all substrings and take the smallest one with minimum len.
Problem C - Iterate the
I strongly feel,
Zerodha >> Grow
Codeforces UI >> Hackerrank UI
Counter-Strike >> Valorant
I have talked with multiple 20-year-olds who strongly feel the other way around in all three of those.
It's super surprising to me.
Programming languages I have used till now with usage.
1. C++ : Tower Research HFT Infra, Google search backend, Competitive Programming
2. Python : Modeling, lots of colab scripting
3. Java : Some frontend
4. SQL : Lots of database querying
5. Javascript : Random chrome
Programming languages I have used till now, in order of usage.
1. Kotlin : Android
2. C++ : DSA
3. Python : Backend/ AI
4. C# : Unity Gamedev
5. Javascript : Creative Coding
6. Java : Android, CC
7. Dart : 1 App for task
8. Go: Learning currently
QT with yours
Should I make an educational playlist explaining string algorithms?
I am thinking to use CSES problems to explain the algorithms and can be recommended for folks to practice as well.
I have had to read lots of completely new codebases in the past as part of my professional work for different SWE jobs at Google, Tower Research Capital, Intuit, and for personal curiosity/work.
Sharing my mental model of how one can approach a large unknown codebase 🧵
I have 2700+ contest rating in Leetcode contests. I am amongst the top 0.07% of users.
My recommendation on how beginners can start with practicing leetcode -
- Start with easy-difficulty problems in the beginning.
- If you are able to solve most of the easy-difficulty problems
Reached my highest Atcoder rating till now.
I am now Yellow on Atcoder.
For reference of folks unknown to competitive programming, there are total of only 30 such people in India.
Hard to swallow pill - Most folks who say they want to improve DSA/CP/problem solving, need to learn/re-learn basic maths first, that's their bottleneck.
I have 6 years of working experience now. 3 years at Google and previously similar time at Tower Research Capital.
One very counter-intuitive thing I have learned with experience is, being fully responsible for getting something done at work isn't a burden, it's your leverage.
If you're in college and tech, try multiple things DSA, Dev, CP, ML, Web Dev, etc.
College time is too early to fix your domain, it's the perfect time for exploration.
𝗔𝗰𝗰𝗼𝗿𝗱𝗶𝗻𝗴 𝘁𝗼 𝗺𝗲, 𝘁𝗵𝗶𝘀 𝗶𝘀 𝘁𝗵𝗲 𝗺𝗼𝘀𝘁 𝗶𝗺𝗽𝗼𝗿𝘁𝗮𝗻𝘁 𝘁𝗶𝗽 𝗳𝗼𝗿 𝗶𝗺𝗽𝗿𝗼𝘃𝗶𝗻𝗴 𝗰𝗼𝗺𝗽𝗲𝘁𝗶𝘁𝗶𝘃𝗲 𝗽𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗶𝗻𝗴 𝘀𝗸𝗶𝗹𝗹𝘀.
𝗨𝗽𝘀𝗼𝗹𝘃𝗶𝗻𝗴.
Giving regular contests is very useful for practice. But the main learning happens in
All India Rank 2 in Leetcode Contest today.
Problem A - Find the rectangle with the largest diagonal and return the area of it. General tip for such problems, no need to do square root or anything similar, we are comparing so finding the exact diagonal isn't important, only the
I am planning to make a detailed video on how to improve problem solving skills. This will cover both general DSA solving skills and some specific competitive programming advice too.
I already have things like how to structure practice to improve skills efficiently, etc in my
Praggnanandhaa just beat Magnus Carlsen in a classical chess game for the first time ever. Well done Pragg! You made India Proud.
Not sure how many folks realize this but beating Magnus in a classical game is a much much bigger deal than any of the previous times Pragg beat
If you hang out with 3 intelligent people, you'll be the 4th.
If you hang out with 3 millionaires, you'll be the 4th.
If you hang out with 3 fitness freaks, you'll be the 4th.
If you hang out with 3 idiots, you'll be the one doing DSA vs Dev.
Chinese table tennis player Ma Lin, Olympic champion of Men's single, has a world rank of 94 on leetcode. His back-up is the goal of many of us. Hats off to Sports & coding culture of China
Tips for interns for the internship period 🧵
Personally, I interned at Intuit during my college time. I got the PPO. I couldn't join there though because of different factors, I chose to join Tower Research Capital after college.
My suggestions for the internship period -
I actually want to teach advanced/hard algorithmic topics too to folks like centroid node decomposition, heavy light decomposition, fractional cascading, wavelet tree, etc.
But I have my doubts about the audience of such topics - how many people will be interested in these.
"I have solved 100/200 questions on Leetcode, still I am not improving"
This is one of the questions that I receive many times from folks.
I understand the 𝘯𝘶𝘮𝘣𝘦𝘳 𝘰𝘧 𝘱𝘳𝘰𝘣𝘭𝘦𝘮𝘴 𝘴𝘰𝘭𝘷𝘦𝘥 is an objective and a very convenient metric, but it's not a good one.
Advanced C++ Tip
From C++20, there is now a new operator Three-way comparison operator.
It's denoted by <=>
Because of its symbol, it's also called spaceship operator.
Given (a, b) It returns
< 0 if a < b
= 0 if a == b
> 0 if a > b
One major benefit of this operator is now
Facebook-Meta Hacker Cup - I Qualified for round 3.
Total 28 folks qualified from India.
Problem Intuitions -
Problem A1: Ready, Go (Part 1) - Consider this as a graph. Make components of nodes having White stones. Then create edges between these components and empty places. Now
Classic set to practice all standard algorithms of graph theory. It starts from really basic ones and goes till really super hard ones.
If you're a beginner you can try the first half as after that problems are reasonably tough. For folks with decent skill levels, all problems
Sharing my solutions for the complete CSES Tree Algorithms section.
It covers most of the common tree concepts like finding diameter etc. and relatively difficult but standard concepts like finding a centroid too.
Find the link to solutions in the reply.
Codeforces Round 883 Div.3 - Overall good contest for me. AIR 8.
Let's discuss how did it go for you
All Problems A-G Intuitions 🧵
Problem A - Need to cut all the ropes which are shorter than the height their nail is at.
Problem B - Classic Tic Tac Toe, check for all three
Happy Diwali Folks!
It's been great fun interacting with everyone here in the past few months.
I'm glad to see 9,789 folks are finding my posts useful. Let's see if it gets to 10k today on Diwali.
Codeforces Round 898
All Problems Intuitions -
Problem A - If all three positions are wrong, then we can't fix them. Otherwise, we can always fix it.
Problem B - Only 10 numbers, check for all cases by increasing each by one at a time.
Problem C - You can find points of a
Collection of T-shirts won in competitive Programming competitions.
This is the subset I could easily find :D
Most of these are from college time.
Many of these are in wrapper because I had multiple copies of the same ones, so some of these never got out :D
Ask me anything
It's a hard pill to swallow.
But if you're stuck in 1000-1200 range in codeforces after doing regularly for a few months, it's very likely that your fundamental math and logic building are very weak.
It's not about competitive programming. You need to work on those things.
Hard to swallow pill - Having solved 500 DSA problems means nothing. It in itself doesn't tell anything about your problem skills.
It's the same as saying I have covered 500kms. That doesn't tell anything about your running capability.
How did you solve those problems, how
If you struggle with dynamic programming, make your CSES dynamic programming problem section look like this.
This problem section covers most of the topics and common techniques.
Unlike a few other sections of CSES, most in this section are beginner-friendly.
Find the problem
Some of my Personal Goals for 2024
- Bring body fat % < 20 from ~24% at present.
- Learn basic music theory and a decent level of Guitar.
- Make > 10 videos simplifying a hard algorithmic topic.
- Play less chess, especially blitz.
- Play more badminton, improve smashes.
Will
The more fundamental your understanding of a concept is, the more type of problems you can solve using that.
Let's say you know binary search.
If your mental model is - Whenever the array is sorted, I can use binary search to find the target element.
That is one kind of common
Ankur Warikoo's whole Youtube channel is basically 5th grade math for adults.
These videos being so popular tells us how bad the average population is in elementary math.
Codechef Round 101 - Div.1
Overall Good contest for me. AIR 2. Was able to solve all 5 problems.
All Problems Intuitions -
Problem Warrior Chef - If we choose value as X, then that means all the values greater than that will have to be reduced from our strength. So iterate in
There are two phases of a Competitive Programmer.
- I am such a genius.
- I am really stupid.
There is no in-between.
One keeps oscillating between these two from time to time.
Sometimes both stages can occur within a span of a few seconds in both possible orders of
I am 2200 rated on Codeforces, which most people would say is a decent rating.
Still, when I am making a video on an algorithmic topic, I am so cautious that I don't teach anything wrong by mistake. I often try to proofread the video after making.
On the other hand, I see many
Codeforces Round 888
All Problems Intuitions -
Problem A - Check if the difference of height is more than 0 and a multiple of K which is less than m.
Problem B - Sort all odd numbers and all even numbers in their positions. Check if the whole array is sorted now.
Problem C -