我试图编写这 3 个代码但没有成功:
aList.foldLeft(List()){(accu, element) => map.get(elment):::accu}
aList.foldLeft(List()){(accu, element) => if (!map.get(element).isEmpty) map.get(element):::accu}
aList.foldLeft(List()){(accu, element) => map.get(elment).exists(_:::accu)}
有谁知道如何将选项连接到列表?