Certainly violent algorithm times out, the array is divided into three parts, can be realized using two linear time Finger
Setting a first pointeri=0 , the second pointerj=A.size()−1 , the next determination condition pointer movement
Because the array elements have both positive and negative, so we can not compare the size of a way to determine the pointer to move, then we start directly from the results, and if there is an equal and are not1 / 3 , we will move the pointer until it can not move up