我需要过滤给定的矢量,以便输出仅包含那些不是直接相邻元素的重复元素。
Example : I/P -> [1 1 3 2 2 4 5 5]
O/P -> [3 4]
最佳答案
(defn isolated [coll]
(->> coll
(partition-by identity)
(remove next)
(map first)))
https://stackoverflow.com/questions/54698712/
相关文章:
python - 如何将三个列表转换为字典,其中键取自前两个列表的笛卡尔积,值取自第三个列表
nuxt.js - Nuxt : Difference nuxtServerInit vs Mddl
list - 我怎样才能找到一个列表包含在任何元素中的另一个列表?
visual-studio-code - VS Code 安装 Visual Studio Code
dictionary - clojure 中的 map 给出了意想不到的结果
vue.js - 无法使用 vue-html2pdf 将 HTML 代码转换为 PDF