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 | 476 Views, 19433 Search Bots | 95 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 476 Views, 19433 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 | 476 Views, 19433 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
- Find the non-duplicate number
- Consecutive Ones
- Daily Interview Problem: Find the k-th Largest Element in a List
- Daily Interview Problem: Decode String
- Daily Interview Problem: Given two arrays, write a function to compute their intersection.
- Algorithm Interview Question: Symmetric k-ary Tree
- Daily Interview Problem: Running Median
- [Daily Problem] Add two numbers as a linked list
- Daily Interview Problem: Count Number of Unival Subtrees
- Daily Interview Problem: Reverse Words in a String
©2006~2024 SteakOverCooked - 0.00806 Seconds(s) - 2494.919 KB/s - 26 Online Memory: 493.4 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 !