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 | 381 Views, 18378 Search Bots | 95 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 381 Views, 18378 Search Bots | 95 Words
| 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:
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 381 Views, 18378 Search Bots | 95 Words 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
Related Articles
- ImageMagick Vulnerabilities - CVE-2016–3714
- Daily Interview Problem: Contiguous Subarray with Maximum Sum
- Daily Interview Problem: Find the k-th Largest Element in a List
- Daily Interview Problem: Jump to the End
- Detect Linked List Cycle
- Algorithm Interview: Smallest Number that is not a Sum of a Subset of List
- Daily Interview Problem: Spiral Traversal of Grid
- [Daily Problem] Remove Consecutive Nodes that Sum to 0
- YES!!
- A trick for getting good at coding interviews FASTER
©2006~2024 SteakOverCooked - 0.0096 Seconds(s) - 2109.542 KB/s - 9 Online Memory: 492.96 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" />
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Comments (0)
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !