This lesson contains extra practice exercises, some of which are challenging. If you get stuck, feel free to skip to the next problem or lesson and come back later. You can always use the My Progress page to review all past exercises.
The first exercise is about debugging. It tries to use a formula that is not quite correct to compute population growth.
The rest of the exercises in this lesson are about the
Simplifying a complex expression
max(x - 3, min(x + 10, x + 5))
x + 5is always smaller than
x + 10, we can simplify
min(x + 10, x + 5)to just
x + 5. Then working our way outwards, the entire expression is
max(x - 3, x + 5). Since
x + 5is always the maximum of these two numbers, that is the result.
Complicating a simple expression
The final problem is a challenging problem, about sorting numbers in a weird way. There are better, simpler, and faster sorting methods that you can learn about after completing our introductory lessons.
If you get stuck, feel free to skip the problem. You can always come back to it later. Additionally, you can keep track of what you have or have not finished by visiting the My Progress page.
Continue on to lesson 3!