如何将以下两个列表合并为一个:
Convert To Integer
和组合列表将是:
${result} = power ${2} ${4}
Should Be Equal As Integers ${result} 16
答案 0 :(得分:2)
确定。首先,您需要将第一个列表转换为地图。
val l1 = List((1,1),(4,4),(5,4),(8,4),(9,5))
val l2 = List((1,4),(1,9),(5,9),(8,9))
val mapL1 = l1.toMap
val requiredList = l2.map({ case (i, j) => (mapL1(i), mapL1(j)) })