Ad

Given 4 Integer Arrays with size 4 like this:

[null, 100, 110, 120] Force

[130, null, 140, 150] Radius

[160, 170, null, 180] Mass 1

[190, 200, 210, null] Mass 2

You will have to find out and replace all nulls with their respective value using Newton's laws of motion.

F=Gm1m2/d2

You will apply the formula index by index meaning index F[0] array will be placed in the formula with index 0 from the other 3 arrays (r[0], mass1[0] and mass2[0]), the same with index 1, 2 and 3.

All values will be correct, there will be no negatives or insanely big values.

The output will be a Double type Array with the 4 values in order. Meaning that index 0 will be the Force, index 1 will be the radius, index 2 will be mass 1 and index 3 will be mass 2.