Get next greater elements of each element in an Array