Find the Smallest Element
Easyjavapythonccppjavascript
Given an array of N integers, find the smallest element in the array.
Input Format
The first line contains an integer N. The second line contains N space-separated integers.
Output Format
Print a single integer — the smallest element of the array.
Example 1
Input
5 8 3 6 1 5
Output
1
Explanation: 1 is smaller than every other element.
- 1 <= N <= 100000
- -1000000000 <= A[i] <= 1000000000
Submit an attempt to unlock the solution. (Sign in first.)
Related Problems
- Find the Largest ElementEasy · java, python, c, cpp, javascriptSolve Problem
- Find the Second Largest ElementEasy · java, python, c, cpp, javascriptSolve Problem
- Reverse an ArrayEasy · java, python, c, cpp, javascriptSolve Problem