Write a program that takes an array of 4 integers (which represents a sequence of numbers generated by a certain algorithm) and returns the next integer that would follow.
We will only be using simple addition, subtraction, multiplication and division algorithms with a constant (i.e non-variable) variation.
For division we will use the
floor integer values:
133/4 = 33 and
33/4 = 8
You can assume that there will always be one single valid return value
[14,24,34,44] should return 54 (addition Algorithm)
[105,45,-15,-75] should return -135 (subtraction algorithm)
[5,25,125,625] should return 3125 (multiplicative algorithm)
[256,64,16,4] should return 1 (division algorithm)