Start learning free

LESSON 147 OF 348 · LOOPS & GLOBAL VARIABLES

Maximum Value in Array in Rust

Practice

Given an array of integers, return the maximum value from the array.

Example:

Input: nums = [2, 7, 11, 8, 11, 8, 3, 11]
Output: 11
Explanation: The maximum value is 11

Note:

Do not use builtin functions such as max(), it would defy the purpose of the challenge. Write the whole code yourself.

STEP 1 OF 5
    Ctrl + Enter to check

    Max In Array in Rust

    Keep going with RustAbout 340 step-by-step lessons, from your first line of code to coding interviews. Free to start.
    Start learning free