Solution
constraints are not that high, so even bruteforce will work (check the biggest consecutive square starting from all Row col combinations
On top of that you might do it in constant time if you have precalculated maximum square to the right and maximum square to the bottom as shown on the picture.
So you define recursive function as "what is the biggest square starting from the current r,c" and add memoization. Bottom up conversion I will post in a bit.
So you define recursive function as "what is the biggest square starting from the current r,c" and add memoization. Bottom up conversion I will post in a bit.
❤1
andreyka26_se
Solution constraints are not that high, so even bruteforce will work (check the biggest consecutive square starting from all Row col combinations On top of that you might do it in constant time if you have precalculated maximum square to the right and maximum…
Hope you already did you own conversion from the top down to bottom up, here it is:
we reuse matrix as our dp table, as it is so convenient. Every cell will represent the maximum length of square that can be formed from this cell, and it is so conveniently precomputed here for us (1 means 1 square is definitely possible, and 0 means no)
Then we reverse the recursive function call stack and start not from the beginning but from the end. We change recursive function call to dp table call and everything else we leave almost the same
Then we reverse the recursive function call stack and start not from the beginning but from the end. We change recursive function call to dp table call and everything else we leave almost the same
❤1
andreyka26_se
https://www.youtube.com/shorts/AUlkrjcyKnk
that's why on ALLLLLL tools inside MS I'm very satisfied and happy employee
Just got contacted by one recruiter from crypto. They have FIVE ROUNDS xDDD ridiculous, FAANG level. I definitely don't want to join any crypto shit, only if it is the biggest and in core functionality just to know how it works in real prod.
let's see, I want to try the interview process there.
On top of that it is devops engineer, and instead of System Design they have "devop interview" for devops eng.
Does anybody know about it? what is going to happen there? Recruiter told that it will be just theoretical questions about devops and best practices there.
let's see, I want to try the interview process there.
On top of that it is devops engineer, and instead of System Design they have "devop interview" for devops eng.
Does anybody know about it? what is going to happen there? Recruiter told that it will be just theoretical questions about devops and best practices there.
Daily
https://leetcode.com/problems/count-submatrices-with-all-ones/description/?envType=daily-question&envId=2025-08-21
Today is painful day. Was not able to come up with the solution on my own
#daily
https://leetcode.com/problems/count-submatrices-with-all-ones/description/?envType=daily-question&envId=2025-08-21
Today is painful day. Was not able to come up with the solution on my own
#daily
Daily
Feels like fresh air - go and collect the coin
https://leetcode.com/problems/find-the-minimum-area-to-cover-all-ones-i/description/?envType=daily-question&envId=2025-08-22
#daily
Feels like fresh air - go and collect the coin
https://leetcode.com/problems/find-the-minimum-area-to-cover-all-ones-i/description/?envType=daily-question&envId=2025-08-22
#daily
now see the pain, first pic - my solution, second pic - official solution.. fuck my life😁
😁6
Daily is deadly today
I had almost no idea how to solve it, so I just checked the solution after 20 mins. It is too much effort I guess.
If I'm getting this on the interview - I will not join the company 1000%
https://leetcode.com/problems/find-the-minimum-area-to-cover-all-ones-ii/description/?envType=daily-question&envId=2025-08-23
#daily
I had almost no idea how to solve it, so I just checked the solution after 20 mins. It is too much effort I guess.
If I'm getting this on the interview - I will not join the company 1000%
https://leetcode.com/problems/find-the-minimum-area-to-cover-all-ones-ii/description/?envType=daily-question&envId=2025-08-23
#daily
😁7❤3
Solution
Basically I will explain and draw the solution so at least you can understand it. Understanding the solution is also very useful skill.
We have 6 ways to split the area. Do you remember daily few days ago? Find the minimum area with 1's? So we are going to apply this algo in each of these sections.
Now what we need to do is try out all these sections, and find minimum area in each of them, and then run min(prev, currentlycalculated) over them as result to return
We have 6 ways to split the area. Do you remember daily few days ago? Find the minimum area with 1's? So we are going to apply this algo in each of these sections.
Now what we need to do is try out all these sections, and find minimum area in each of them, and then run min(prev, currentlycalculated) over them as result to return
❤2