我真的需要这个任务的帮助,如下所示:我需要使用地图系列来实现这个功能。
映射子(列表 1,列表 2)。
Subtracts List2 from List1
Follows the order of appearance in
List2.
Implement it using map family
Examples:
mapSub([1,2,3,4,5,1,2,3,4,5],[1,1,2]).
[2,3,4,5,3,4,5]
mapSub ([1,2,3,4,5,1,2,3,4,5],[1,1,2,2]).
[2,3,4,5,3,4,5]
问题是如何使用我允许使用的功能来管理 List2,例如,
如果我从 List2 中找到第一个元素并删除他在 List1 中的第一次出现。
如何将我要查找的元素替换为
List2 尾部的头部(List2 中的下一个元素)
谢谢。