Given an integer array nums, find and return the minimum element in the array.
You must solve it without using any built-in min functions.
Input: An integer array nums of length n.
Output: A single integer — the minimum element.
Input: [3,1,4,1,5,9,2,6]
Output: 1
Explanation: Start min=3. 1<3→min=1. 4,1,5,9,2,6 — none less than 1. Return 1.Input: [-5,-1,-3,-2]
Output: -5
Explanation: Start min=-5. -1>-5, -3>-5, -2>-5 — min stays -5. Return -5.Input: [42]
Output: 42
Explanation: Single element is trivially the minimum. Return 42.1 <= nums.length <= 10^5-10^9 <= nums[i] <= 10^9