Solved part 1 of Arrays and Sorting problems