id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

jebbert@volusia.k12.fl.us > testHL_Q12
prev  |  next  |  chance

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)

public int testHL_Q12(int[] nums) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 350

Copyright Nick Parlante 2017 - privacy