Just No more free questions left!

Upgrade Now

Given an array of integers, find the highest product you can get from three of the integers.

The input arrayOfInts will always have at least three integers.

Does your function work with negative numbers? If arrayOfInts is [-10, -10, 1, 3, 2] we should return 300 (which we get by taking -10 * -10 * 3).

We can do this in time and space.

You must log in with one click to view the rest.

Once you're logged in, you'll get free full access to this and 4 other questions.

You must log in with one click to view the rest.

Once you're logged in, you'll get free full access to this and 4 other questions.

time and additional space.

  1. What if we wanted the highest product of 4 items?
  2. What if we wanted the highest product of k items?
  3. If our highest product is really big, it could overflow. How should we protect against this?

You must log in with one click to view the rest.

Once you're logged in, you'll get free full access to this and 4 other questions.

What's next?

RUN
Code execution powered by Qualified.io

. . .