To the Top
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 | 170 Views, 16244 Search Bots | 79 Words

Subscribe to Feed Burner | Browse | Archive
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:


def products(nums):
# Fill this in.

print products([1, 2, 3, 4, 5])
# [120, 60, 40, 30, 24]
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 170 Views, 16244 Search Bots | 79 Words Subscribe to Feed Burner

Related Articles

  1. Daily Interview Puzzle: Intersection of Linked Lists
  2. Algorithm Interview: Determine If Linked List is Palindrome
  3. Fibonacci coding
  4. Algorithm Interview Question: Symmetric k-ary Tree
  5. [Daily Problem] Move Zeros
  6. Daily Interview Problem: Reconstrunct Binary Tree from Preorder and Inorder Traversals
  7. Sorting a list with 3 unique numbers
  8. Daily Interview Problem: Distribute Bonuses
  9. Daily Interview Problem: Longest Substring With K Distinct Characters
  10. Daily Interview Problem: Find the Number of Islands

Comments (0)

Your Email (Domain Part Not Exposed):

Your Comments:

Privately By Mail Colors More Smileys S x y @

Verification (Click Image 2 Refresh):

    Be the first one to comment this page !


Page Edited: October 30 2020 14:21:09 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />