[Huawei OD test questions] Statistical number of matching binary groups (python) 100% pass rate super detailed code comment code interpretation

[Huawei OD machine test real questions 2022&2023] real test catalog @click here @
[Huawei OD machine test real questions] signal transmission and reception & trial reading & @click here @
[Huawei OD machine real test questions] rent a car to ride the greenway & trial reading & @点here@

counts the number of matching pairs

Array of knowledge points
Time limit: 1s Space limit: 32MB Limited language: unlimited

Title description:

Given two arrays A and B, if an element A[i] of array A and an element B[j] of array B satisfy A[i]==B[j], then find a matching value The two-tuple (i,j) of . Please count how many such binary groups exist in these two arrays A and B.

Enter a description:

The length M of array A is input in the first line;
the length N of array B is input in the second line;

Guess you like

Origin blog.csdn.net/weixin_45541762/article/details/130673027