Watch the walkthrough below. Want to learn more? Head to the demo page.
Create a class
SquaredSorter that provides a single class method named
maxOfSortedSquares accepts an array of
If the passed array is
null or empty, throw an
Otherwise, proceed as follows.
First, square every value of the array.
Next, sort the array in ascending order.
Finally, return the maximum of the squared, sorted array.
Modify the array in place, and do not create a copy.
Sort the array using a helper method from
Provide students with feedback not just on correctness, but also on code quality. Instantly. On every submission.
Your course staff aren't good at reading code. And it's not a good use of their time. Free them to work directly with students!
Over 500 questions for Java and Kotlin. Designed to support beginning programmers. Embeddable into your own materials.