subject : Yes 5 Arrays of different lengths a1,a2,a3,a4,a5, Now take a number from the array , Form a new array , Request from a1 The number taken out must be less than from a2 Number taken , From the same principle a2 The number taken out must be less than from a3 Number taken , and so on , Lists all arrays that meet the criteria .

The title is quite simple , Take a look at it , And then I used a bunch of them for the first time for loop , The script is as follows :
a1 = [1,2,4] a2 = [2,3,4,5] a3 = [1,4,7] a4 = [3,6,7,8] a5 = [3,6,8,9,10] for i
in a1: for j in a2: for k in a3: for l in a4: for m in a5: if i<j<k<l<m: print(i

The output is right , But look at this pile for loop , I always feel uncomfortable , After a search , Found out itertools.product(A,
B) This function , This function returns A,B Tuple of Cartesian product of elements in , Seems to meet the conditions , So the script above changes to the following
import itertools for i in itertools.product(a1,a2,a3,a4,a5): if i[0]<i[1]<i[2]<
i[3]<i[4]: print(i)

©2020 ioDraw All rights reserved
LeetCode quick get start ① —— Array series ( Often asked in an interview , Suggested collection ) Apple iPhone 12 Price leakage : The official highest price is close to 1 Ten thousand yuan ( Essence )2020 year 6 month 26 day C# Class library Ip Address help class spark.sql.shuffle.partitions and spark.default.parallelism The difference between flutter study -- Search box NVIDIA official apology : Robots are sold out RTX 3080django Do not close CSRF middleware , Custom through CSRF Tested post request 【 Deep learning 】 Target detection in progress IOU The concept and calculation of ( Essence )2020 year 6 month 26 day C# Class library DataTable( Extension method ) Can Huawei Hongmeng system and Android , Apples compete against each other ?