Home >Backend Development >PHP Tutorial >Efficient sorting problem
<code>$a=[1,2,3]; $b=[11,13,15]; 排序结果: 1,11 1,13 1,15 2,11 2,13 2,15 3.... </code>
Seeking ideas
<code>$a=[1,2,3]; $b=[11,13,15]; 排序结果: 1,11 1,13 1,15 2,11 2,13 2,15 3.... </code>
Seeking ideas
Sort the two lists separately, then use the high-priority list as the first-level loop, the low-priority list as the second-level loop, and do the Cartesian product of the two lists