O(n) , travel once