● videoPractice
Practice: Product of All Numbers But This

Unlock this course
Subscribe for full access to every course, or buy this one on its own.
SECTION
Practice
NEXT UP
Practice: Smallest Range of K Lists
COURSE
Coding Interview Bootcamp
17 lessons
About this lesson
Here's another practice question from Interview Cake, who kindly allowed me to use this other questions in this production.
Once again - I encourage you to do your best before watching all of the video. We can then try to solve it together!
Here’s the question:
Write a function getProductsOfAllIntsExceptAtIndex() that takes an array of integers and returns an array of the products.
Starter code:
<span class="hljs-comment">//Given...</span>
[<span class="hljs-number">1</span>, <span class="hljs-number">7</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>]
<span class="hljs-comment">//Return </span>
[<span class="hljs-number">84</span>, <span class="hljs-number">12</span>, <span class="hljs-number">28</span>, <span class="hljs-number">21</span>]
<span class="hljs-comment">//... in other words...</span>
[<span class="hljs-number">7</span> * <span class="hljs-number">3</span> * <span class="hljs-number">4</span>, <span class="hljs-number">1</span> * <span class="hljs-number">3</span> * <span class="hljs-number">4</span>, <span class="hljs-number">1</span> * <span class="hljs-number">7</span> * <span class="hljs-number">4</span>, <span class="hljs-number">1</span> * <span class="hljs-number">7</span> * <span class="hljs-number">3</span>]
Unlock Coding Interview Bootcamp
Subscribe for full access to every course, or buy this one on its own.