revise the solution of ArrayFour problem