Amazon Interview Question

Count the occurrence of a target number in a sorted array