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

 

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

Write a method that finds the least product of any pair of integers in the array of positive integers. If the array is too short to have a pair of integers simply return zero. Look at the test data for examples. You may NOT hard-code an assumed initial maximum product! (If you don't understand what this means, ask me)


dec9_2016_SLHL_leastProduct([5, 7, 1, 3, 6]) → 3
dec9_2016_SLHL_leastProduct([7000, 3000, 5000, 9000, 12400]) → 15000000
dec9_2016_SLHL_leastProduct([4, 22, 18, 2, 1, 4, 5, 100, 5, 6, 3]) → 2

...Save, Compile, Run (ctrl-enter)

public int dec9_2016_SLHL_leastProduct(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: 250

Copyright Nick Parlante 2017 - privacy