Dsa
Arrays
Easy
Maximum Absolute Difference
Given an array of integers, calculate the maximum absolute difference between any two elements in the array. The input format is as follows:
- The first line will contain n (1 <= n <= 1000).
- The second line will contain n integers, which represent the elements of the array.
Output a single integer, which is the maximum absolute difference.
Example:
Input:
5
1 3 7 0 5
Output:
7
Key concepts
arraysabsolute differencecomparison
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now