[removed] how to remove duplicate arrays inside array of arrays

后端 未结 5 1450
生来不讨喜
生来不讨喜 2020-12-10 12:19

Input:

[[-1,-1,2],[-1,0,1],[-1,-1,2],[-1,0,1],[-1,-1,2],[-1,0,1],[-1,0,1]]

The output I want:

[[-1,-1,2],[-1,0,1]]
<         


        
5条回答
  •  粉色の甜心
    2020-12-10 13:09

    There's already a good utility for that, try Lodash, one of the function of it is _.uniqWith, with that function you can do the following.

    
    
    

提交回复
热议问题