to find second largest element of an array