Count Occurrences In Sorted Array Leetcode Question