product_of_the_others() function that takes in an array of integers and replaces each number in the array with the product of all the numbers in the array except the number at that index itself.
product_of_the_others([1, 2, 3, 4, 5]) should return
[120, 60, 40, 30, 24], and
product_of_the_others([5, 5, 5]) should return
[25, 25, 25].
This challenge was reported to have been asked at interviews with Google. If you’ve covered the material in Pass the Technical Interview with Python or an equivalent, you should be able to solve this challenge. If you have trouble, try refreshing your knowledge with its Algorithmic Complexity content.