Daily
Easy one - go and collect coins
https://leetcode.com/problems/sort-matrix-by-diagonals/description/?envType=daily-question&envId=2025-08-28
#daily
Easy one - go and collect coins
https://leetcode.com/problems/sort-matrix-by-diagonals/description/?envType=daily-question&envId=2025-08-28
#daily
Daily
https://leetcode.com/problems/alice-and-bob-playing-flower-game/description/?envType=daily-question&envId=2025-08-29
Usually when I see Alice and Bob I want them to fucking grow up and stop playing the game, but this time it is not that hard task:
think of it as this, no matter what number of flowers are on the lanes, both Alice and Bob will be picking from either of them, so you can imagine it as just bunch of flowers consisting of x + y sub bunches.
Hint: if the number of flowers is even - then Alice will loose, if number of flowers is odd - Alice will win
https://leetcode.com/problems/alice-and-bob-playing-flower-game/description/?envType=daily-question&envId=2025-08-29
Usually when I see Alice and Bob I want them to fucking grow up and stop playing the game, but this time it is not that hard task:
think of it as this, no matter what number of flowers are on the lanes, both Alice and Bob will be picking from either of them, so you can imagine it as just bunch of flowers consisting of x + y sub bunches.
Hint:
❤3
Solution
Official solution is one liner, but I guess mine is a bit easier to understnd.
So we have 2 numbers, we need to count all the pairs that will result to odd sum.
In this case, we get all odd numbers in n (fix it in the way) and multiply by the number of even numbers forming this (oddnumber, evennumber)
Then we switch and count the same but vice versa (evennumber, oddnumber)
Then we sum, and this is the solution
So we have 2 numbers, we need to count all the pairs that will result to odd sum.
In this case, we get all odd numbers in n (fix it in the way) and multiply by the number of even numbers forming this (oddnumber, evennumber)
Then we switch and count the same but vice versa (evennumber, oddnumber)
Then we sum, and this is the solution
Tomorrow going for my first vacation maybe in 3 years, where I'm not going for interview onsite or something like that. And hopefully I will get to some sea (if we don't crush in airplane).
And soon will tell you story about kiwi and Croatian airlines. THe stupidest shit ever happened on this kind of service. I mean, I literally wanted to tell their support: pay me my 30$/h and I will show you how these services should be designed, implemented AND TESTED!!
And soon will tell you story about kiwi and Croatian airlines. THe stupidest shit ever happened on this kind of service. I mean, I literally wanted to tell their support: pay me my 30$/h and I will show you how these services should be designed, implemented AND TESTED!!
😁10👍1🤔1
BUT,
Daily leetcode will be performed no matter what!!! Maybe we even do small stream, we will see
Daily leetcode will be performed no matter what!!! Maybe we even do small stream, we will see
❤8
Daily
backtracking sudoku (hard)
https://leetcode.com/problems/sudoku-solver/description/?envType=daily-question&envId=2025-08-31
#daily
backtracking sudoku (hard)
https://leetcode.com/problems/sudoku-solver/description/?envType=daily-question&envId=2025-08-31
#daily
Solution
I'm under kynedryl, so completely zoned out.I made up some backtracking solution, it is not the best, ofc, but it passes.
In general - we try every possible number, until we reach the end. If we reached the end - it is solved.
I'm under kynedryl, so completely zoned out.
In general - we try every possible number, until we reach the end. If we reached the end - it is solved.
❤4