Тёмный

LeetCode 874 - Walking Robot Simulation - Java 

Alpha-Code
Подписаться 1,8 тыс.
Просмотров 369
50% 1

Solution, explanation, and complexity analysis for LeetCode 874 in Java
Problem Description:
leetcode.com/p...
Code:
github.com/Ana...

Опубликовано:

 

21 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 3   
@MM.Esmail
@MM.Esmail 17 дней назад
Nice video
@definitelysandeep
@definitelysandeep 17 дней назад
I created a if-else hell for directions it works just as the simulation says, but I wonder how what can we do if the inputs were large ? Binary search or something ?
@Alpha-Code
@Alpha-Code 17 дней назад
Would definitely be interesting if that were the case, we would basically have to figure out if we can go from a to b with no obstacle in the path in log(n) or better time. Something I'm thinking of is like maybe have a prefix sum of obstacles in the grid or something row by row and column by column that we can probably bin search with. So if you check obstacles at b vs obstacles at a we should have the same sum if there are none in the path then you can bin search through that space to find first place where it differs maybe. This would work if the obstacle numbers aren't too big but we have a lot of commands and the commands aren't 1-10 but like 1-10^4 or something.
Далее
A* (A Star) Search Algorithm - Computerphile
14:04
Просмотров 1,1 млн
БЕЛКА РОЖАЕТ?#cat
00:20
Просмотров 362 тыс.
iPhone 16 Ultimate Battery Test!
13:25
Просмотров 2,6 млн
Making an Algorithm Faster
30:08
Просмотров 46 тыс.
MIT Introduction to Deep Learning | 6.S191
1:09:58
Просмотров 567 тыс.
How I Got Good at Coding Interviews
6:29
Просмотров 1,6 млн
Object-Oriented Programming Is The Root Of All Evil
25:16