write a function in JavaScript or python that takes an array of integers and determines if the array is Arithmetic or Geometric | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 1

write a function in JavaScript or python that takes an array of integers and determines if the array is Arithmetic or Geometric

if the array argument is Geometric return 'Geometric', if Arithmetic return 'Arithemetic', else return -1. No loops are allowed.

26th Jun 2017, 9:22 PM
Elijah Bobzom
Elijah Bobzom - avatar
2 Antworten
+ 1
@nobody nice try. but try any arithmetic array with zero as the first input. it returns the wrong answer.
22nd Sep 2017, 9:17 PM
Elijah Bobzom
Elijah Bobzom - avatar