loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.6863387420885241","path":"index.js","file":{"path":"index.js","content":{"asEncoding":{"base64":"Y29uc3QgbGFyZ2VzdE51bWJlciA9IChudW1BcnIpID0+IHsNCiBudW1BcnIuc29ydCgoYSwgYikgPT4gew0KICAgIHJldHVybiBwYXJzZUludChgJHtifSR7YX1gKSAtIHBhcnNlSW50KGAke2F9JHtifWApOw0KICB9KTsgICAgDQogIHJldHVybiBwYXJzZUludChudW1BcnIuam9pbignJykpOw0KfQ0KDQpjb25zb2xlLmxvZyhgTGFyZ2VzdCBOdW1iZXI6ICR7bGFyZ2VzdE51bWJlcihbNTAsIDIsIDEsIDksIDVdKX1gKTsgLy8gOTU1MDIxIC0gUEFTUw0KY29uc29sZS5sb2coYExhcmdlc3QgTnVtYmVyOiAke2xhcmdlc3ROdW1iZXIoWzUwLCA1LCA1Nl0pfWApOyAvLyA1NjU1MCAtIFBBU1MNCmNvbnNvbGUubG9nKGBMYXJnZXN0IE51bWJlcjogJHtsYXJnZXN0TnVtYmVyKFs0MjAsIDQyLCA0MjNdKX1gKTsgLy8gNDI0MjM0MjAgLSBQQVNT"},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
const largestNumber = (numArr) => {
 numArr.sort((a, b) => {
    return parseInt(`${b}${a}`) - parseInt(`${a}${b}`);
  });    
  return parseInt(numArr.join(''));
}

console.log(`Largest Number: ${largestNumber([50, 2, 1, 9, 5])}`); // 955021 - PASS
console.log(`Largest Number: ${largestNumber([50, 5, 56])}`); // 56550 - PASS
console.log(`Largest Number: ${largestNumber([420, 42, 423])}`); // 42423420 - PASS
node v10.16.0