[Huawei OD test questions] port merge (associated port combination merge) (python) 100% pass rate super detailed code comment code optimization

[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@

Association Port Group Merge

Associated Port Combination
Time Limit: 1s Space Limit: 256MB Limit Language: Unlimited

Title description:

There are M (1<=M<=10) port groups, and each port group is an integer array with a length of N (1<=N<=100). If there are 2 or more different ports in the same port group, then The two port groups are considered to be related to each other and can be merged.
The first line enters the number of port groups M, and then enters M lines, each line is separated by a comma, representing the port group, and the output combined port group is represented by a two-dimensional array

Enter a description:

Guess you like

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