正在加载视频...

视频加载失败

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

相关视频