LeetCode 489. Robot Room Cleaner

  Рет қаралды 12,059

Happy Coding

Happy Coding

Күн бұрын

Пікірлер: 14
@mushiewaffle
@mushiewaffle 4 жыл бұрын
You have the best explanations on KZbin that I have seen! What is your background? Are you a Senior Software Engineer?
@coolvjh
@coolvjh 3 жыл бұрын
Very well explained. Thank you 😀
@Paunitza
@Paunitza 3 жыл бұрын
Great explanation! Thank you!
@aunnfriends
@aunnfriends 4 жыл бұрын
Here is a bit of feedback. Please zoom in the screen on the code when you are coding, otherwise it is hard to see for some other people. My eyesight is not that bad but I still need to make an effort to see the code. Keep up the good work!
@happycoding1093
@happycoding1093 4 жыл бұрын
Thanks for the feedback, I zoom to 150% in my latest video, it should be big enough.
@mickys4999
@mickys4999 3 жыл бұрын
why do we need the below code next_d = (d + i)%4 if i use the below code like normal DFS, then why it throws recursion depth exceeded for dir in directions: new_x = x+ dir[0] next_y = y + dir[1] why robot.move() doesnt return False
@happycoding1093
@happycoding1093 3 жыл бұрын
next_d = (d + i)%4 to make sure next_d is in the range of [0,3]
@happycoding1093
@happycoding1093 3 жыл бұрын
my guess is that your robot stuck in an infinite loop, and that's why robot.move does not return False
@nene7292
@nene7292 2 жыл бұрын
For direction, why is up: (-1, 0) and not (0, -1)? Since the coordinate is of format (x, y), I would think the y would be -1 for up...
@muhammadrehanalikhan1453
@muhammadrehanalikhan1453 2 жыл бұрын
its actually not (x,y) coordinate. Its rows and cols. By convention, the top left corner of 2D grid is considered (row =0, col = 0). So: incrementing row == going down & incrementing col == going right
@yang5843
@yang5843 3 жыл бұрын
Thank you!
@anilkatakam2738
@anilkatakam2738 3 жыл бұрын
Helpful. thank you.
@vishalmishra9549
@vishalmishra9549 3 жыл бұрын
thanks :)
@rasi9441
@rasi9441 Жыл бұрын
isnt it the time complexity O(N), where N is the number of cells? because each cell is visited once. I think 4^N should have been the case if we was doing repetitive work, but since we are tracking with visited, we should be okay.
ROBOT ROOM CLEANER | LEETCODE # 489 | PYTHON BACKTRACK SOLUTION
19:44
Cracking FAANG
Рет қаралды 11 М.
How I Failed the Google Coding Interview (and lessons I learned)
14:24
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 111 МЛН
How Senior Programmers ACTUALLY Write Code
13:37
Thriving Technologist
Рет қаралды 1,6 МЛН
LeetCode 351. Android Unlock Patterns
25:34
Happy Coding
Рет қаралды 5 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 197 М.
LeetCode 490. The Maze
19:37
Happy Coding
Рет қаралды 8 М.
Robot Room Cleaner (LeetCode 489 - Hard)
24:56
TechMockInterview
Рет қаралды 4,9 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
Coding Unbreakable Encryption in C | One-Time Pad
17:42
HirschDaniel
Рет қаралды 4,4 М.
MINESWEEPER (Leetcode) - Code & Whiteboard
20:32
babybear4812
Рет қаралды 10 М.
Robot Room Cleaner | Leetcode 489 | DFS & Backtracking | HARD
14:50
Arpan Pathak
Рет қаралды 1,2 М.