Comments

Arash Shoar3 months ago

const distance = elem => Math.sqrt(elem[0] ** 2 + elem[1] ** 2)

const solve = (intArray) => { return intArray.sort((a, b) => distance(a) - distance(b)); };