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

 

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

You will be passed in two arrays. 'I' is an array of currents. 'R' is an array of resistances. Values in the same array position correspond to each other. If those two arrays have the same length, return an array of the corresponding voltages, where voltage is found by multiplying the current times the resistance (V=I*R). However, if the arrays are not the same length, or if either array is empty, simply return an empty array.


drWhoLikesElectricity([2, 3], [5, 1]) → [10, 3]
drWhoLikesElectricity([5, 7, 3], [1, 2]) → []
drWhoLikesElectricity([1, 2, 3, 4, 5, 6, 7], [7, 6, 5, 4, 3, 2, 1]) → [7, 12, 15, 16, 15, 12, 7]

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

public int[] drWhoLikesElectricity(int[] I, int[] R) { }

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: 220

Copyright Nick Parlante 2017 - privacy