We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I've implemented a simple lookahead building upon @princealonte solution after noticing you only need contextual information from 3 adjacent values that you compare from the current index.
New Year Chaos
You are viewing a single comment's thread. Return to all comments →
I've implemented a simple lookahead building upon @princealonte solution after noticing you only need contextual information from 3 adjacent values that you compare from the current index.
We just have to update the lookahead values depeding on three cases.
Here the corresponding c++ solution :