Count the number of elements within a specified range in a sorted array that contains duplicates #leetcode #binarysearch #compsci