Daily (119 day streak)
This could have been typical dynamic programming problem for 5 mins, BUT, by 38% acceptance rate + people scresming that it should be hard one - now it is not that easy.
Spoiler, O(n^2) will give TLE. We need something more optimized here. Didn't come up with it yet, will do tomorrow after sleep
https://leetcode.com/problems/count-partitions-with-max-min-difference-at-most-k/description/?envType=daily-question&envId=2025-12-06
#daily #medium
This could have been typical dynamic programming problem for 5 mins, BUT, by 38% acceptance rate + people scresming that it should be hard one - now it is not that easy.
Spoiler, O(n^2) will give TLE. We need something more optimized here. Didn't come up with it yet, will do tomorrow after sleep
https://leetcode.com/problems/count-partitions-with-max-min-difference-at-most-k/description/?envType=daily-question&envId=2025-12-06
#daily #medium
π1
Daily (120 day streak)
This easy feels like blessing after yesterday's question.
https://leetcode.com/problems/count-odd-numbers-in-an-interval-range/description/?envType=daily-question&envId=2025-12-07
#daily #easy
This easy feels like blessing after yesterday's question.
https://leetcode.com/problems/count-odd-numbers-in-an-interval-range/description/?envType=daily-question&envId=2025-12-07
#daily #easy
π3
Daily (121 day streak)
Happy monday, easy problem.
https://leetcode.com/problems/count-square-sum-triples/description/?envType=daily-question&envId=2025-12-08
#daily #easy
Happy monday, easy problem.
https://leetcode.com/problems/count-square-sum-triples/description/?envType=daily-question&envId=2025-12-08
#daily #easy
π1
Daily (122 day streak)
Happy Tuesday, actually amazing problem, exactly how medium should be. Enjoyed it, however I have read the first hint to get the idea behind the map usage.
https://leetcode.com/problems/count-special-triplets/description/?envType=daily-question&envId=2025-12-09
#daily #medium
Happy Tuesday, actually amazing problem, exactly how medium should be. Enjoyed it, however I have read the first hint to get the idea behind the map usage.
https://leetcode.com/problems/count-special-triplets/description/?envType=daily-question&envId=2025-12-09
#daily #medium
π4
Daily (123 day streak)
Happy Wednesday. Today is interesting problem. The kind of problem, when you need to figure out few things and then solution is really trivial. For me was a bit hard to understand what is needed.
Initially I thought that we count dependency chain. E.g. in the 1st example,
THE ASK HERE IS to count the order of computers being unlocked. So
Testcase
https://leetcode.com/problems/count-the-number-of-computer-unlocking-permutations/description/?envType=daily-question&envId=2025-12-10
#daily #medium
Happy Wednesday. Today is interesting problem. The kind of problem, when you need to figure out few things and then solution is really trivial. For me was a bit hard to understand what is needed.
Initially I thought that we count dependency chain. E.g. in the 1st example,
[0,1,2] => means pc1 was unlocked from pc0, pc2 was unlocked from pc1. IT IS NOT.THE ASK HERE IS to count the order of computers being unlocked. So
[0,1,2] => also means pc1 was unlocked from pc1, and pc2 was unlocked from pc0.Testcase
[2,68,61], expected number of permutations is 2https://leetcode.com/problems/count-the-number-of-computer-unlocking-permutations/description/?envType=daily-question&envId=2025-12-10
#daily #medium
π1π₯1
During the daily, I discovered interesting compiler optimization or whatever it is.
Case1. I'm using
Case2. I'm using
Case1. I'm using
permutations *= cnt % mod => gives 3600msCase2. I'm using
permutations = permutations * cnt % mod => gives 11msπ€3
andreyka26_se
During the daily, I discovered interesting compiler optimization or whatever it is. Case1. I'm using permutations *= cnt % mod => gives 3600ms Case2. I'm using permutations = permutations * cnt % mod => gives 11ms
UPD:
For now seems strange
permutations *= cnt -> 3000ms
permutations = permutations * cnt -> 3000ms
permutations = permutations * cnt % mod -> 17ms
permutations = (permutations * cnt) % mod -> 17ms
permutations *= cnt % mod -> 3000ms
For now seems strange
π€1
andreyka26_se
UPD: permutations *= cnt -> 3000ms permutations = permutations * cnt -> 3000ms permutations = permutations * cnt % mod -> 17ms permutations = (permutations * cnt) % mod -> 17ms permutations *= cnt % mod -> 3000ms For now seems strange
Actually makes sense. The smaller the numbers the quicker the multiplication.
p *= cnt % mod will be converted to p = p * (cnt % mod). So basically we will always work with bigger numbers
Order of operations isfrom left to right for β*β and β%β as they are same βrankβ
p *= cnt % mod will be converted to p = p * (cnt % mod). So basically we will always work with bigger numbers
Order of operations isfrom left to right for β*β and β%β as they are same βrankβ
π1π€―1
Daily (124 day streak)
Happy Thursday. Amazing problem, I love problems that are representing some abstract model, that you can imagine, or even better - real world model, rather than just some numbers. Today is exactly that type of problems
https://leetcode.com/problems/count-covered-buildings/description/?envType=daily-question&envId=2025-12-11
#daily #medium
Happy Thursday. Amazing problem, I love problems that are representing some abstract model, that you can imagine, or even better - real world model, rather than just some numbers. Today is exactly that type of problems
https://leetcode.com/problems/count-covered-buildings/description/?envType=daily-question&envId=2025-12-11
#daily #medium
π3
Fun fact, did you know you can add contributions/commits to github for the past and for future days. E.g. just added for 24th of Dec.
My ex techlead has shared the fun repo, and I was really doubting how it can add for the past or for the future, but it can for new empty repo
https://github.com/Shpota/github-activity-generator
My ex techlead has shared the fun repo, and I was really doubting how it can add for the past or for the future, but it can for new empty repo
https://github.com/Shpota/github-activity-generator
π₯2
Well actually even in already created repo, you can do it, and it will be reflected in activity.
Here I created commit in 2026th.
But you would need to play with query parameters in github so it is shown:
https://github.com/andreyka26-git?tab=overview&from=2025-12-01&to=2026-12-11
Here I created commit in 2026th.
But you would need to play with query parameters in github so it is shown:
https://github.com/andreyka26-git?tab=overview&from=2025-12-01&to=2026-12-11
π₯2π1
I love Google ecosystem for personal use, Tasks, Calendar, Keep (notes), Drive/Docs, etc.
The only one thing I was not happy about Google Notes (Keep) is rich text editing (bold, italic formats, headings, etc).
THEY HAVE ADDED IT!!!
Was waiting for it for 3-4 years. On top of that every now and then I see improvements and new features for Google Tasks.
Love Google. At some point I will be hired there. Want to work on some of these personal / time management tools.
The only one thing I was not happy about Google Notes (Keep) is rich text editing (bold, italic formats, headings, etc).
THEY HAVE ADDED IT!!!
Was waiting for it for 3-4 years. On top of that every now and then I see improvements and new features for Google Tasks.
Love Google. At some point I will be hired there. Want to work on some of these personal / time management tools.
π₯12
Daily (125 day streak)
Actually nice problem. Feels like some version of real engineering problem that somebody had.
https://leetcode.com/problems/count-mentions-per-user/description/?envType=daily-question&envId=2025-12-12
#daily #medium
Actually nice problem. Feels like some version of real engineering problem that somebody had.
https://leetcode.com/problems/count-mentions-per-user/description/?envType=daily-question&envId=2025-12-12
#daily #medium
π2
Daily (126 day streak)
Happy Saturday. Today is easy, so few mins problem - get your coin.
https://leetcode.com/problems/coupon-code-validator/?envType=daily-question&envId=2025-12-13
#daily #easy
Happy Saturday. Today is easy, so few mins problem - get your coin.
https://leetcode.com/problems/coupon-code-validator/?envType=daily-question&envId=2025-12-13
#daily #easy
π₯2
Daily (127 day streak)
It is Medium+ or even Medium, not Hard for sure. Especially given the hints.
https://leetcode.com/problems/number-of-ways-to-divide-a-long-corridor/description/?envType=daily-question&envId=2025-12-14
#daily #hard
It is Medium+ or even Medium, not Hard for sure. Especially given the hints.
https://leetcode.com/problems/number-of-ways-to-divide-a-long-corridor/description/?envType=daily-question&envId=2025-12-14
#daily #hard
π1