about | help | code help+videos | done | prefs |
Write a method that accepts an array of non-negative integers with at least two elements. Your goal is to find the largest product of any two integers in the array, which you will then return. For example, the largest product of any two integers from {1, 3, 2, 5, 1} is 15 (3*5). Notice that you are not allowed to use the same number from the same index in the array twice, so in the above example, the largest product is NOT 25 (5*5). However, in {1, 3, 5, 5, 1} the largest product IS 25. testHL_Q12([2, 6, 3, 1, 8, 5, 4, 2]) → 48 testHL_Q12([4, 4, 4, 4, 4]) → 16 testHL_Q12([8, 10, 2, 1, 0, 3]) → 80 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 350
Copyright Nick Parlante 2017 - privacy