andreyka26_se
1.13K subscribers
1.23K photos
158 videos
9 files
700 links
Hey, I'm software engineer at Microsoft, with 8+ years of experience. Here we are talking about F(M)AANG big tech interviews: leetcode, system design and corpo life.

YouTube: @andreyka26_se
Instagram: andreyka26_se
TikTok: @andreyka26__
Download Telegram
For those who are on the stream:

https://algo.monster/liteproblems/2534

from collections import deque

def time_taken_to_cross_the_door(arrival: list[int], state: list[int]) -> list[int]:
entering = deque()
exiting = deque()
doorstate = 0

t = arrival[0]
person = 0
res = [0] * len(arrival)
while person < len(arrival) or entering or exiting:
if person < len(arrival) and t < arrival[person] and len(entering) == len(exiting) == 0:
t = arrival[person]
doorstate = 0
continue
elif person < len(arrival) and t == arrival[person]:
while person < len(arrival) and arrival[person] == t:
if state[person] == 1:
exiting.append(person)
else:
entering.append(person)
person += 1

competitive = len(entering) > 0 and len(exiting) > 0

if not competitive:
if entering:
res[entering.popleft()] = t
doorstate = 1
else:
res[exiting.popleft()] = t
doorstate = 2
else:
if doorstate == 0 or doorstate == 2:
p = exiting.popleft()
res[p] = t
doorstate = 2
elif doorstate == 1:
p = entering.popleft()
res[p] = t
doorstate = 1

t += 1

return res

if __name__ == "__main__":
arrival = [int(x) for x in input().split()]
state = [int(x) for x in input().split()]
res = time_taken_to_cross_the_door(arrival, state)
print(" ".join(map(str, res)))
❀1
Daily 383d day streak

A bit tough problem, but not enough to be hard, but it has a pattern, so I would still recommend.

https://leetcode.com/problems/lexicographically-smallest-permutation-greater-than-target/description/?envType=daily-question&envId=2026-08-27

#daily #medium #pattern
❀1
From now on - please call me sensei
😁11
Media is too big
VIEW IN TELEGRAM
IMHO, wdyt?
❀5πŸ‘4πŸ”₯2
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ”₯3
andreyka26_se
Video message
Burnout therapy. Just before training I wanted to resign. Now I even want to work a bit.

Lately it was first time for past 8 years (whole career) that I wanted to take vacation.
But I literally cannot, because manager nicely hinted that I should be around due to some important thing, and also I should deliver stuff noone else knows how to deliver on timeπŸ˜…
❀3
andreyka26_se
Burnout therapy. Just before training I wanted to resign. Now I even want to work a bit. Lately it was first time for past 8 years (whole career) that I wanted to take vacation. But I literally cannot, because manager nicely hinted that I should be around…
Remember, if you cannot take single day off, cause there is no one else that can take it over - this is huge redflag.

In Microsoft you can safely die, and it will be alright. Generally there are at least 2 engineers per feature who have knowledge.
πŸ‘9❀1
This media is not supported in your browser
VIEW IN TELEGRAM
❀4
Quick food and I start the stream, +- in 20
❀1
Daily 384 day streak

For me - seems very complicated and I have to skip such long/hard problems while we are doing Leetcode marathon. But it has pattern, so I cannot say skip, as well as I cannot say musthave.

https://leetcode.com/problems/lexicographically-smallest-palindromic-permutation-greater-than-target/description/?envType=daily-question&envId=2026-08-28

#daily #hard #pattern
❀4
10 minutes and we go leetcode marathon
❀2
andreyka26_se
10 minutes and we go leetcode marathon
Come and join I will do small announcement, and then leave. I know it is boring to watch somebody struggling with leetcode. So I understand.

It is only for duration of marathon, and then I will switch to regular content: networks, system design and finally will finish Prague -> Dublin relocation
❀8
I am sorry, I fixed sound
❀2
The machine that joined the stream, and was teaching me about leetcode. Happy to have such strong people. Big respect to the guy

He solved all of them in ONE YEAR!!
πŸ”₯9🀯1
andreyka26_se
7/16 https://www.youtube.com/live/0R68bjkv5j4 #leetcode #stream
Almost 4 hours of PURE LEETCODE that has finished (unsuccessfully) with leetcode daily xDDD.

Thanks to all who were with me
🀯11πŸ”₯1
Streaming in 30-60 mins
πŸ”₯4
Daily 385th day streak

Pretty complicated question (to develop the intuition, coding itself is mid level).

I would still recommend, as it has nice pattern to know (remember).

https://leetcode.com/problems/make-lexicographically-smallest-array-by-swapping-elements/description/?envType=daily-question&envId=2026-08-29

#daily #medium #pattern
❀3