File: root - text - article - 2019 - 12 - product-of-array-except-self.txt.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 216 Views, 18132 Search Bots | 79 Words
| Browse | Archive
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 216 Views, 18132 Search Bots | 79 Words
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Hi, here's your problem today. This problem was recently asked by Amazon:
You are given an array of integers. Return an array of the same size where the element at each index is the product of all the elements in the original array except for the element at that index.
For example, an input of [1, 2, 3, 4, 5] should return [120, 60, 40, 30, 24].
You cannot use division in this problem.
Here's a start:
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 216 Views, 18132 Search Bots | 79 Words You are given an array of integers. Return an array of the same size where the element at each index is the product of all the elements in the original array except for the element at that index.
For example, an input of [1, 2, 3, 4, 5] should return [120, 60, 40, 30, 24].
You cannot use division in this problem.
Here's a start:
def products(nums):
# Fill this in.
print products([1, 2, 3, 4, 5])
# [120, 60, 40, 30, 24]
![Subscribe to Feed Burner Subscribe to Feed Burner](/images/form/rss.gif)
Related Articles
- Daily Interview Problem: Min Stack
- Algorithm Interview: Maximum Path Sum in Binary Tree
- Daily Interview Problem: Tree Serialization
- [Daily Problem] Remove k-th Last Element From Linked List
- Spectrum Master
- Daily Interview Problem: Word Ordering in a Different Alphabetical Order
- Daily Interview Problem: Spiral Traversal of Grid
- Algorithm Interview Question: Find the Single Element in an Array of Duplicates
- Daily Interview Problem: Merge K Sorted Linked Lists
- Windows Scripting
©2006~2024 SteakOverCooked - 0.01636 Seconds(s) - 3268.98 KB/s - 48 Online
Memory: 529.65 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />
![](/images/top.jpg)
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !