How to sort an Array to avoid consecutive duplicates

前端 未结 0 1096
渐次进展
渐次进展 2020-11-29 03:06

I have an array of numbers [1,2,2,2,3,4,5]

What I want to do is to sort the array to avoid equal numbers consecutively [1,2,3,2,4,2,5]. but I don\'t want to delete an

相关标签:
回答
  • 消灭零回复
提交回复
热议问题