Google | Onsite | Largest value of the expression
1566

You are given a list of non-negative integers. Find the largest value of the expression you can get by using +, * and ( ) operators.

Example:

Input: [1, 2, 1, 2]
Output: 9
Explanation: (1 + 2) * (1 + 2) = 9

Follow-up:
Negative values are allowed.

Comments (6)