const removeNonUnique = array => {
const dict = array.reduce((acc,it) => {
if(acc[it]){
acc[it] = {...acc[it], count: acc[it].count + 1}
return acc
}
acc[it] = {value: it, count: 1}
return acc
}, {})
return Object.keys(dict).filter((it) => dict[it].count < 2)
}