What's the time complexity of the program? Should it be O(n^2) for the worst although the average running time seems much shorter? One test case is as follows: the first two number are the same, then increase them one by one, and the target is the sum of the last two numbers. eg:

[2,2,3,4,5,6,7,8,9] and the target is 17

Also, I want to know what running time given by the test system means? Is it the average running time for 19 cases?