Overlap Count
Return how many items of a also appear somewhere in b. Each item of a is counted on its own, so repeats in a count every time. Hint: np.isin.
Example 1
a [1,2,2,5]
b [2,5,9]
returns 3
The items 2, 2 and 5 are in b.
Constraints
1 <= len(a), len(b) <= 100
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.
More NumPy problems
- Pass or FailBeginner
- Percent of TotalBeginner
- Pick ItemsBeginner
- Price With TaxBeginner
- Range of ReadingsBeginner
- Recent AverageBeginner
- Running TotalBeginner
- Same PositionsBeginner