My issue
Please help to clear my doubt
Here in these code why do WWE use
mini = 100 strong text
Is it declare so that no garbage value should be given as output ???
My code
#include<bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
int t ;
cin>>t ;
while(t--){
int N ;
cin>>N ;
int S[101] , **mini=100** ;
for(int i=0 ;i<N ; i++ ){
cin>>S[i] ;
}
sort(S,S+N) ;
for(int i=0 ;i<N-1 ; i++ ){
mini = min(mini , S[i+1] - S[i]);
}
cout<<mini<<endl ;
}
return 0;
}
Learning course: Sorting using C++
Problem Link: CodeChef: Practical coding for everyone