Same Positions
a and b are two arrays of the same length. Return how many positions i have a[i] == b[i], as an int.
Example 1
a [1,2,3,4]
b [1,0,3,0]
returns 2
They match at positions 0 and 2.
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
- Shopping TotalBeginner
- Side by Side ColumnsBeginner
- Sign of EachBeginner
- Sorted DistinctBeginner
- Standard DeviationBeginner
- Swap Rows and ColumnsBeginner
- Third QuartileBeginner
- Votes TallyBeginner