Solutions

Learn about the solutions to the problems from the previous lesson.

Let’s see how to solve the exercises from the previous lessons.

Excercise 1: Extending binary search

In this case, we need to do two binary searches—one for each variable. That’s why it’s difficult to scale this algorithm to solve problems with many variables.

Let’s see the solution code:

Get hands-on with 1400+ tech skills courses.