Algorithms + Data Structures = Programs cover image

Episode 135: 🇸🇮 Slovenia 🇸🇮 2023 Road Trip!

Algorithms + Data Structures = Programs

00:00

The Competitive Programming Trick

A plus scan on positive values with a binary search is like a classic solution to certain competitive programming problems. If you just do a plus scan in advance on your whole sequence of enemies that you're going to be facing, you can just do multiple binary searches. So instead of having a quadratic solution, you end up with an n log n solution. And then k is the number of times you're able to beat the waves or something like that.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app