Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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 Aufrufe • vor 1 Jahr •via X (Twitter)

10 Kommentare

Profilbild von louis
louisvor 1 Jahr

@grok

Profilbild von Kaushal
Kaushalvor 1 Jahr

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)

Profilbild von TechMaven
TechMavenvor 1 Jahr

a minimum of 1000 checks is necessary

Profilbild von JK
JKvor 1 Jahr

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

Profilbild von placoo
placoovor 1 Jahr

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.

Profilbild von AIGIRL
AIGIRLvor 1 Jahr

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

Profilbild von Loksly
Lokslyvor 1 Jahr

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.

Profilbild von Metal.Bot
Metal.Botvor 1 Jahr

499 if previous librarians were sober, else 999

Profilbild von Paul Thomas 💙
Paul Thomas 💙vor 1 Jahr

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

Profilbild von dinn
dinnvor 1 Jahr

Devide and conquer

Ähnliche Videos