Question d’entretien chez Uber

Given a sorted array find out how many duplicates there are, given user input.