Skip to content

Comment on The sliding window minimum algorithm

Comments

This reminds me of the following problem:

Given a list of numbers, for each number n print (n, k) where k is the first number following n that is larger than n.

There is a linear solution

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.