Help Python Sort Algorithm Javascript Interview Question