Search Small Ones in Java
You are given with an array, now you need to find the small and second small element from the array and then show sum of small and second small output.
Input
4
1 0 -1 2
Output:
-1
Input:
7
1 2 3 4 5 6 7
Output:
3
4
1 0 -1 2
Output:
-1
Input:
7
1 2 3 4 5 6 7
Output:
3
Comments
Post a Comment