How to generate an array of discontiguous data

there is duplicate data in a set of data, such as 11223456, how to generate a set of discontiguous permutations, such as 12123456

Mar.28,2021

var arr = '11222333456'.split('');
var obj = {},maxlength;
var newString = '';
for(let key in arr){
    let value = arr[key];
    obj[value] = obj[value]? PPobj[value] : 1;
}
for(let key in obj){
    maxlength = maxlength? (maxlength > obj[key] ? maxlength : obj[key]) : obj[key];
}
for(let i = 0; i < maxlength; iPP){
    for(let key in obj){
    let count = obj[key];
    if(count > 0){
        newString +=key;
        obj[key]--;
    }
}
}
console.log(newString) 

//12345612323

I don't know if it's what you want

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b40827-4f182.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b40827-4f182.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?