SilvaneUX / donut-test

a free resource for really really beginners to explore basic code and join Hacktoberfest
3 stars 54 forks source link

Second Largest Element in an Array without sorting #91

Open SiddhiShivale opened 3 weeks ago

SiddhiShivale commented 3 weeks ago

Problem explanation: -

Example 1: Input: [1,2,4,7,7,5] Output: Second Smallest : 2 Second Largest : 5 Explanation: The elements are as follows 1,2,3,5,7,7 and hence second largest of these is 5 and second smallest is 2

Example 2: Input: [1] Output: Second Smallest : -1 Second Largest : -1 Explanation: Since there is only one element in the array, it is the largest and smallest element present in the array. There is no second largest or second smallest element present.

Hey @SilvaneUX I want to contribute in hacktoberfest2024. If you find this problem useful please add a tag to it and assign me the same.

SilvaneUX commented 3 weeks ago

you can create pull request now

SiddhiShivale commented 3 weeks ago

created