https://ideas.creativecasinoties.com/post/find-first-and-last-occurrences-in-a-sorted-array-fpe58v