Get Minimum Watch Score
This Amazon interviews coding interview problem analyzes a viewer’s watch history. You’re given an array of series IDs over n days and two target IDs (series1 and series2). The watch score of a contiguous period is the number of distinct series watched during that period. The interview question asks for the minimum watch score among all day ranges where both target series appear at least once; if the IDs are the same, one occurrence is enough. Implement getMinScore to return that minimal integer result.
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Input Variables
Execution Result:
