Sure Tiago. There’s point in everything you said, no denying that. The only thing offbeat about the article was the addressal of these edge cases.
A reader might be tempted to use the explained algorithm right away, but it’s always better to warn them about the caveats associated with using them.

At the culmination of your article, you could’ve instilled curiosity in the readers by saying that the above algorithm would need rework if there are updates in the array. Think about why?
This is my only grievance here. Cheers.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store