2min chapter

The Array Cast cover image

Fold and Scan

The Array Cast

CHAPTER

How to Find the Smallest Window at Every Time

There's a known way to do this to keep the to keep enough information so that you can find the smallest window at every time. And it runs in linear time and it uses maybe in the worst case, it uses an amount of memory that's equal to the window size. But I looked at this and I said, well, you know, if the window is small enough, what I should really be doing is taking taking pairwise maximums in powers of two. That lets me use array operations. And then I tested this out and it performed very well. What I actually found was I couldn't find any combination of arguments where that linear time C solution was better than this logar

00:00

Get the Snipd
podcast app

Unlock the knowledge in podcasts with the podcast player of the future.
App store bannerPlay store banner

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode

Save any
moment

Hear something you like? Tap your headphones to save it with AI-generated key takeaways

Share
& Export

Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more

AI-powered
podcast player

Listen to all your favourite podcasts with AI-powered features

Discover
highlights

Listen to the best highlights from the podcasts you love and dive into the full episode