Back/Pointer Basics: Largest Value

Pointer Basics: Largest Value

EasyLevel: 8Topic: Linked Lists
XP Reward:+50 XPCoin Reward:+5 Coins

You are given a list of integers. Find the largest value present in the list.

This problem is part of Linked Lists practice and is designed to strengthen the Pointer Basics pattern.

Input Format

  • The first line contains an integer n, the number of values.
  • The second line contains n space-separated integers.

Output Format

Return one integer: the maximum value in the list.

Example 1

Input:

8
-8 11 30 49 -29 -10 9 28

Output:

49

Explanation:

  • Scanning all values, the largest one is 49.
  • No other value in the list is greater than it.

Constraints

  • 1 <= n <= 10^5
  • -10^9 <= value <= 10^9

Return Requirement

Implement the starter function for this Easy problem. Read from the raw input string and return only the required answer, with no labels or debug text.

Judge Behavior

Run Code checks the visible sample cases. Submit checks those samples plus additional hidden cases that follow the same input format and constraints.

Loading editor...
Input
8
-8 11 30 49 -29 -10 9 28
Expected Output
49