I need to find out the difference between the current element and all the previous elements. But when there are more than 1200 or so elements my is exhausting the time limit