用转成ascll码解题
const line = readline();
let arr = line.split('').map(item=>item.charCodeAt());
let map = new Map()
let count= 0;
let str = '';
let oldcot = 0;
arr.forEach((item,key)=>{
if(key !== 0){
if(item === arr[key-1]+1&&key!==arr.length-1){
str += String.fromCharCode(arr[key-1]);
count++;
}else{
if(count > oldcot){
map.set(count,str+String.fromCharCode(arr[key-1]));
map.delete(oldcot)
oldcot = count;
if(item === arr[key-1]+1){
map.set(count,map.get(count)+String.fromCharCode(item));
}
}
count = 0;
str = '';
}
}
})
console.log(...map.values())
const line = readline();
let arr = line.split('').map(item=>item.charCodeAt());
let map = new Map()
let count= 0;
let str = '';
let oldcot = 0;
arr.forEach((item,key)=>{
if(key !== 0){
if(item === arr[key-1]+1&&key!==arr.length-1){
str += String.fromCharCode(arr[key-1]);
count++;
}else{
if(count > oldcot){
map.set(count,str+String.fromCharCode(arr[key-1]));
map.delete(oldcot)
oldcot = count;
if(item === arr[key-1]+1){
map.set(count,map.get(count)+String.fromCharCode(item));
}
}
count = 0;
str = '';
}
}
})
console.log(...map.values())