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 | 497 Views, 20771 Search Bots | 95 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 497 Views, 20771 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 | 497 Views, 20771 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
- Non-decreasing Array with Single Modification
- Number of Ways to Climb Stairs
- Daily Interview Problem: Largest BST in a Binary Tree
- Multitasking
- Algorithm Interview Question: H-Index
- ImageMagick Vulnerabilities - CVE-2016–3714
- Algorithm Interview: Lowest Common Ancestor of 2 Nodes in Binary Tree
- Daily Interview Problem: Tree Serialization
- Daily Interview Problem: Distribute Bonuses
- New Vulnerabilities (CVE-2016-4581) have been detected in CentOS/RHEL/CloudLinux 7
©2006~2024 SteakOverCooked - 0.00884 Seconds(s) - 2251.881 KB/s - 14 Online Memory: 494.41 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="index, 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 !