Given the following function:
function sortFunction(str) {
// return srt
}
console.log(sortFunction("20 150 2343 20 9999"));
I am trying to make a function that returns an string with the same sequence of numbers, but sorted by the sum of its characters.
So I should get ("20 150 2343 9999"). What happens with "20"? If 2 numbers are of the same value, I need to sort them as strings.