Goldman Sachs Interview Question

Create a function that takes in a string array and sorts out the words according to their sizes.