I always prefer give an answer visually. Nested two for loops for all elements can be thought as a matrix. You will do calculations in number of:
n^2 - n
which resides in O(n^2). Visually, it will be something like (X's represent calculations):
With your approach, it will become a triangular matrix something like (X's represent calculations):
So you will end up with calculations in amount of:
(n-1) x n/2
As it can be seen, it is half of previous one, but still resides in O(n^2).