Find Second Largest Element in an array
Problem Statement: Given an array, find the second smallest and second largest element in the array. Print ‘-1’ if either of them doesn’t exist. Example: Example 1: Input: [1,2,4,7,7,5] Output: Second Smallest : 2 Second Largest : 5 Explanation: ...
Jun 26, 20232 min read55


