Smallest Element

L1 Easy Arrays & Hashing
Concept
The same champion technique that found the maximum finds the minimum — just flip the comparison.
Return the single smallest integer in nums. You may assume the array always has at least one element.
Examples
▸ nums = [3, 9, 2, 7]
→ 2
▸ nums = [-1, -5, -2]
→ -5
▸ nums = [7]
→ 7
Progressive Hints
Hint 1 · Nudge
Same keeper trick as largest-element, but you hang onto the smallest instead.
Hint 2 · Plan
Start with the first element as your answer. Scan the rest and replace your answer whenever you find a smaller value.
Hint 3 · Approach
best = nums[0]. For each remaining n: if n < best then best = n. Return best.
Output
// Run your code to see the output here.