Fucking a lot of fun
The assessment is basically hard leetcode question. Involved coordinates and angles between points on coordinates system. Tomorrow we will review, and during stream as well
(For reference: glhf - good luck have fun, usually in rts games people are telling this to opponents)
The assessment is basically hard leetcode question. Involved coordinates and angles between points on coordinates system. Tomorrow we will review, and during stream as well
(For reference: glhf - good luck have fun, usually in rts games people are telling this to opponents)
Daily
https://leetcode.com/problems/length-of-longest-v-shaped-diagonal-segment/description/?envType=daily-question&envId=2025-08-27
Don't be that scared, 50% acceptance rate. Solved in 20 mins. Remember: rotation ONLY clockwise, and ONLY once.
After today's night nightmare with vectors, this is a joke task, really
Hint:Don't try bottom up, just do memoization, cause the number of parameters will be long in your dp function
#daily
https://leetcode.com/problems/length-of-longest-v-shaped-diagonal-segment/description/?envType=daily-question&envId=2025-08-27
Don't be that scared, 50% acceptance rate. Solved in 20 mins. Remember: rotation ONLY clockwise, and ONLY once.
After today's night nightmare with vectors, this is a joke task, really
Hint:
#daily
Solution:
So we will try to start from all possible 1s. It will be dfs traversal. We DON'T have to track visited, cause we can rotate only once, therefore we never will intersect.
dp function will contain current row and current col, current direction, whether we expect to have 2 or 0 at current row, and whether we already changed the dir or not.
It feels like a lot of search space, but in reality, dir, istwo, and dirchanged are at most 2 or 4 different values (constant), what is really changing a lot and depends on input is r and c.
Then you basically follow the rule: try to go already set direction. If you didn't change direction yet - try it (next one clockwised)
dp function will contain current row and current col, current direction, whether we expect to have 2 or 0 at current row, and whether we already changed the dir or not.
It feels like a lot of search space, but in reality, dir, istwo, and dirchanged are at most 2 or 4 different values (constant), what is really changing a lot and depends on input is r and c.
Then you basically follow the rule: try to go already set direction. If you didn't change direction yet - try it (next one clockwised)
👍2❤1
andreyka26_se
gl hf gg
so about this shit. It is interesting how the task was organized. Actually they don't lock screen, they don't have "code" area. Only task assignment and bunch of test cases. you need to solve the problem in your IDE, run the code, and then attach the output of your solution + your solution itself. You have 3-4 hours on completion
❤3
andreyka26_se
so about this shit. It is interesting how the task was organized. Actually they don't lock screen, they don't have "code" area. Only task assignment and bunch of test cases. you need to solve the problem in your IDE, run the code, and then attach the output…
I cannot reveal a lot of stuff, but in general, your thoughts on it, how would you approach the problem:
You are given x,y coordinates of points. On the picture the points: A(x0, y0), B(x1,y1), C(x2,y2), D(x3,y3).
Given point A, you should tell all the points that are laying on the directions that are shown as blue (N(north), NE, E, SE, S, SW, W, NW). Apparently the angle between adjacent 2 directions is 45 degrees, e.g. from N to NE.
As an example for direction NW, we gonna find point B(x1, y1), point D(x3, y3) BUT NOT point C (x2,y2). You should identify such points per direction. So the output will be:
{NW: B, D, ...}
Your input will contain exact coordinates, not just xn,yn.
You are given x,y coordinates of points. On the picture the points: A(x0, y0), B(x1,y1), C(x2,y2), D(x3,y3).
Given point A, you should tell all the points that are laying on the directions that are shown as blue (N(north), NE, E, SE, S, SW, W, NW). Apparently the angle between adjacent 2 directions is 45 degrees, e.g. from N to NE.
As an example for direction NW, we gonna find point B(x1, y1), point D(x3, y3) BUT NOT point C (x2,y2). You should identify such points per direction. So the output will be:
{NW: B, D, ...}
Your input will contain exact coordinates, not just xn,yn.
❤3
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