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

 

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

Preconditions: 'smaller' and 'larger' are both greater than one. 'smaller'<'larger'. 'max' is greater than one. Create an array of positive integers such that each integer in the array has both 'smaller' and 'larger' as factors and the integers in the array are in increasing order. All the integers in the array will be less than or equal to 'max'. For example, if 'smaller'=3, 'larger'=5, and 'max'=33 you would return {15,30} because those are the only two positive integers less than or equal to 33 that have both 3 and 5 as factors. Look at the test data for additional examples.


test2022_12_08_APP1SLHL_factorOfBoth(17, 23, 10) → []
test2022_12_08_APP1SLHL_factorOfBoth(7, 11, 444) → [77, 154, 231, 308, 385]
test2022_12_08_APP1SLHL_factorOfBoth(2, 3, 11) → [6]

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

public int[] test2022_12_08_APP1SLHL_factorOfBoth(int smaller, int larger, int max) { }

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