MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/Maths/ArrayStabilization.cpp:10–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10int main()
11
12{
13
14
15long long n;
16cin>>n;
17long long arr[n];
18for(int i=0;i<n;i++){
19 cin>>arr[i];
20}
21sort(arr,arr+n);
22cout<<min(arr[n-2]-arr[0],arr[n-1]-arr[1]);
23return 0;
24}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected