var a ='aabqaadaqqda'
var b =a.split('')
var c = []
for (var i =0;i
var upValue =''
var nextValue =''
var isSame =false
var value =b[i]
if (i+1
nextValue =b[i+1]
}
if (i>0) {
upValue =b[i-1]
}
if (upValue ===value ||nextValue ===value) {
isSame =true
}
var isHas =false
var d =a.substring(0,i)
if (d.indexOf(value) != -1) {
isHas =true
}
if (isSame ==true ||isHas ==false){
c.push(value)
}
}
console.log('=================',c.join(''))