You are given an array of integers and its size n.Using only pointer arithmetic:
❌ Do not use array indexing like arr[I].✅ Only use pointer movements and dereferencing.
Example-1
Input: n = 5, arr = [10 25 5 30 15] Output: 30
Example-2
Input: n = 4, arr = [1 1 1 1] Output: 1
Example-3
Input: n = 3, arr = [-5 -2 -9] Output: -2
Test Cases
Test Results
Input
5 10 25 5 30 15
Expected Output
30