To the Top
File:  root - text - article - 2019 - 11 - largest-product-of-3-elements.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 170 Views, 14806 Search Bots | 95 Words

Subscribe to Feed Burner | Browse | Archive
Hi, here's your problem today. This problem was recently asked by Microsoft:

By the way, check out our NEW project AlgoPro (http://algopro.com) for over 60+ video coding sessions with ex-Google/ex-Facebook engineers.

You are given an array of integers. Return the largest product that can be made by multiplying any 3 integers in the array.

Example:

[-4, -4, 2, 8] should return 128 as the largest product can be made by multiplying -4 * -4 * 8 = 128.

Here's a starting point:


def maximum_product_of_three(lst):
# Fill this in.

print maximum_product_of_three([-4, -4, 2, 8])
# 128
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 170 Views, 14806 Search Bots | 95 Words Subscribe to Feed Burner

Related Articles

  1. Daily Interview Problem: Merge Overlapping Intervals
  2. Autorun.inf Virus Protection
  3. [Daily Problem] Remove k-th Last Element From Linked List
  4. Daily Interview Problem: Trapping Rainwater
  5. Fix Brackets
  6. Daily Interview Problem: Spiral Traversal of Grid
  7. Algorithm Interview: Smallest Number that is not a Sum of a Subset of List
  8. New Vulnerabilities (CVE-2016-4581) have been detected in CentOS/RHEL/CloudLinux 7
  9. Algorithm Interview: Permutations of numbers
  10. Two Tricks of Delphi

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="noindex, follow" />