Well, last time I asked for an arithmetic sequence, now comes the geometric sequence
Challenge
In this challenge, the input will be an unordered set of numbers and the program should be able to tell if the set of numbers is a Geometric Sequence.
Input
- The input will be a set separated by
,
(comma).
Output
- The Output can be a Boolean (True or False), or a number (1 for True, 0 for False).
Test cases
In: 1,3,9
Out: True
In: 1,4,16
Out: 1
In: 2,6,14
Out: 0
In: 2,8,4
Out: True
In: 4,6,9
Out: 1
Rules
- This is code-golf, so the shortest code by bytes wins.
- The minimum length of the input set would be 3 elements.
Best of Luck
4,6,9
\$\endgroup\$ – isaacg Jul 5 '20 at 17:422, 4, 8
is a geometric sequence, and2, 8, 4
is an unordered version of that set \$\endgroup\$ – caird coinheringaahing Jul 5 '20 at 18:471,1,1
? Is0,0,0
a valid input, and if yes, what's the correct output? \$\endgroup\$ – Zgarb Jul 5 '20 at 20:02