For this Question: Given an array A of size N, find the maximum value of A<sub>i</sub> - A<sub>j</sub> over all i, j such that 1 <= i, j <= N.First line of the input contains a single integer N.
The second line of the input contains N space seperated integers.

Constraints:
1 <= N <= 10<sup>5</sup>
1 <= A<sub>i</sub> <= 10<sup>9</sup>Print the maximum value of A<sub>i</sub> - A<sub>j</sub> over all i, j such that 1 <= i, j <= N.Sample Input:
5
6 7 4 5 2

Sample Output:
5

Explaination:
We take i = 2, j = 5. A<sub>2</sub> - A<sub>5</sub> = 7 - 2 = 5., I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;
 
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
// #define int long long
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using T = pair<int, int>;
typedef long double ld;
 
const int mod = 1e9 + 7;
const int INF = 2e9;
 
void solve(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(auto &i : a) cin >> i;
    sort(all(a));
    cout << a.back() - a[0];
}
 
signed main(){
    fast
    int t = 1;
    // cin >> t;
    for(int i = 1; i <= t; i++){
        solve();
        if(i != t) cout << endl;
    }
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?