/**
* @param {string} num
* @return {string}
*/
var largestGoodInteger = function(num) {
const digitArr = ['999', '888', '777', '666', '555', '444', '333', '222', '111', '000']
for(let digit of digitArr) {
if(num.includes(digit)) return digit
}
return ''
};