Thanks to your leetcode daily videos and neetcode 150 list I finally got an internship opportunity at Amazon. Thanks again 🙏
@bhanunani13072 күн бұрын
please give some suggestions for begineers
@XavierWoods-l9s2 күн бұрын
@bhanunani1307 I think he already made a very good video on the same I would suggest you to follow that and keep grinding leetcode.
@debrajkundu27802 күн бұрын
He teaches DSA and take care of your eyes as well.
@safirswe2 күн бұрын
How about instead of marking a cell guarded, you mark it horizontally or vertically guarded, then when iterating through a guards position horizontally, you stop with all the previous criteria or if it's been horizontally guarded previously, then it'd mean it's guarded from another horizontal direction and we can stop. Same again vertically. I believe it'd speed things up, not enough to change the worst case time complexity, but enough.
@fortitude2422 күн бұрын
Hey @Neetcode, can you group problems by the patterns you have on neetcode, you doing great but just having a playlist by pattern will help us ramp up the prep process as we will only work through patterns which we think we need to work on. What do you think?
@sdemji2 күн бұрын
3:48 it can be done using binary search, the only thing is one have to invert,. "We reverse the question: iterate over all cells and for each one determine if it can be seen by some guard." Mikolaj Murasik. I agree it's annoying to code the mentioned approach but the one Mikolaj used is better tc wise, and is slightly less annoying although less straightforward than the ones from the editorial
@vignarajd12232 күн бұрын
hey, have a question! In some of your videos, you mentioned that the time complexities shown on leetcode may not always be accurate or relevant, but here you used them to compare two approaches this means, leetcode shows us the correct time complexity?
@rahulsihara89462 күн бұрын
i thought you will be on break, nice to see you though.
@bhanunani13072 күн бұрын
i can understand the code ver easily but i am unable to crack the problem and do it myself any help?
@jwsw2 күн бұрын
House Robber V: Escape from jail
@Akash-rg2oe2 күн бұрын
I always wonder how this man solves these questions 2 weeks earlier before they become daily questions.
@oppie3352 күн бұрын
yo !!
@luizfelipe23302 күн бұрын
I solved this problem differently. I actually used a DFS. Now, after seeing your video, I'm feeling dumb, hahaha.
@pwn2424Күн бұрын
The first solution is more efficient than the second solution right?
@floriankubiak73132 күн бұрын
It's sufficient to only mark as 0 or 1, later count the 0s.
@floriankubiak73132 күн бұрын
14:02 you can save the position of the last wall in variable => only 1 pass
@floriankubiak73132 күн бұрын
I'll dump my code here, because I prefer the way to iterate over the grids by using direction-arrays. I like the readability (I'm sure it can be better than the way I did it, advice appreciated) class Solution: def countUnguarded(self, m: int, n: int, guards: List[List[int]], walls: List[List[int]]) -> int: grid = [[0] * n for i in range(m)] for w in walls: grid[w[0]][w[1]] = 1 for g in guards: grid[g[0]][g[1]] = 1 directions = [[-1,0],[1,0],[0,1],[0,-1]] for g in guards: for d in directions: y,x = g y += d[0] x += d[1] while 0
@ilyasramatullaev74162 күн бұрын
thank you so much for making content for us
@unlucky-7772 күн бұрын
I solved it at 650ms in first try. We take those
@rickastley4_the_second2 күн бұрын
nice video
@devmahad2 күн бұрын
thanks :)
@bhanunani13072 күн бұрын
please solve leetcode 493.Reverse Pairs
@EdWestfieldJrКүн бұрын
`Time Limit Exceeded`
@RC230322 күн бұрын
l=[] for i in range(m): li=[] for j in range(n): if [i,j] in guards: li.append('G') continue if [i,j] in walls: li.append('W') continue li.append(0) l.append(li) for i,j in guards: for x,y in [(-1,0),(1,0),(0,-1),(0,1)]: dx,dy=i+x,j+y while 0
@bthulasikrishna95972 күн бұрын
Same here 😅. We are visiting the cells which are already visited.