I have tested this code in a simulating algorithm competition. Unfortunately, I used twice and I have got Twice wrong answer. I wonder why. One of my code is checking a sequence if it is a geometric sequence. I got a wrong answer on 3 test points: 