Suppose we have two arrays A[n] and b[n], the goal is to compare every element in A to elements in B. Then return a list result[n] that records the number of each element in A that is larger than the elements in B.
For example,
A = [38, 24, 43, 3], B = [9, 82, 10, 11]
Since 38 is larger than 9, 10 and 11, so result[0] is 3.
Then result is [3, 3, 3, 0].
It will be the best if you can provide some pseudocode.
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…