Skip to content

Instantly share code, notes, and snippets.

@robconery
Created September 27, 2023 19:16
Show Gist options
  • Save robconery/150dd64af5b8f4aa09007e5692eaaf7c to your computer and use it in GitHub Desktop.
Save robconery/150dd64af5b8f4aa09007e5692eaaf7c to your computer and use it in GitHub Desktop.
Mission Interview All Numbers But This

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:

//Given...
[1, 7, 3, 4]

//Return 
[84, 12, 28, 21]

//... in other words...
[7 * 3 * 4,  1 * 3 * 4,  1 * 7 * 4,  1 * 7 * 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment