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 | 176 Views, 16688 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 | 176 Views, 16688 Search Bots | 79 Words Subscribe to Feed Burner

Related Articles

  1. First and Last Indices of an Element in a Sorted Array
  2. Daily Interview Question: Longest Sequence with Two Unique Numbers
  3. Algorithm Interview Question: Symmetric k-ary Tree
  4. [Daily Problem] Remove k-th Last Element From Linked List
  5. Windows Scripting
  6. Autorun.inf Virus Protection
  7. Daily Interview Problem:Create a balanced binary search tree
  8. Daily Interview Problem: Queue Using Two Stacks
  9. ImageMagick Vulnerabilities -  CVE-2016–3714
  10. Algorithm Interview: Smallest Number that is not a Sum of a Subset of List

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="index, follow">