Загрузка видео...

Не удалось загрузить видео

На главную

Developers, this algorithmic puzzle will test your problem-solving skills. How efficiently can you verify if 1,000 books are in order? Share your solution and reasoning.

30,327 просмотров • 1 год назад •via X (Twitter)

Комментарии: 10

Фото профиля louis
louis1 год назад

@grok

Фото профиля Kaushal
Kaushal1 год назад

Sequentially compare each book with its immediate neighbor (book i vs book i+1). If any pair is out of the defined sequence, stop; the collection is not in order. If all 999 adjacent pairs are correct, the books are verified as sorted. O(n)

Фото профиля TechMaven
TechMaven1 год назад

a minimum of 1000 checks is necessary

Фото профиля JK
JK1 год назад

worst case you’d need to check all 1000 books and compare each to the one before so 999 comparisons butsince you can’t hold two at once you’d keep re-checking the previous one about 1999 checks ... 1 bookmarked 1000 checks

Фото профиля placoo
placoo1 год назад

I'm SelinRabo requests Google support to regain access to my Gmail and YouTube account after losing all passkeys, despite trying multiple devices and recovery options.

Фото профиля AIGIRL
AIGIRL1 год назад

both scenarios 999 times as you checked 1 to 999 you know the 1000th should be right.

Фото профиля Loksly
Loksly1 год назад

what about check a random one. See it's number, let's say it's X, then check number X mod 1000. If it's sorted, keep till the last one.

Фото профиля Metal.Bot
Metal.Bot1 год назад

499 if previous librarians were sober, else 999

Фото профиля Paul Thomas 💙
Paul Thomas 💙1 год назад

I made it 999, or 998 with the bookmark that saves one check.

Фото профиля dinn
dinn1 год назад

Devide and conquer

Похожие видео