Problem statement
Given a non-empty array of integers, return its largest value.
If several cells contain the largest value, the returned value is the same. The visualizer keeps the first such index.
Examples
Inputa = [4, 9, 2, 14, 7]
Output14
The largest value appears at index 3.
Inputa = [8, 3, 8, 1, 8]
Output8
Repeated copies do not change the maximum value.
The walkthrough is part of Premium
The statement and the examples above stay free. The full how-to-solve walkthrough, the cost notes in plain words and the interactive step-by-step visualizer unlock with a Premium plan.
See pricing