You are viewing a single comment's thread. Return to all comments →
c++ solution:-
sort(arr.begin(),arr.end()); int m=INT_MAX; for(int i=1;i<arr.size();++i) if(abs(arr[i]-arr[i-1])<m) m=abs(arr[i]-arr[i-1]); return m;
Seems like cookies are disabled on this browser, please enable them to open this website
Minimum Absolute Difference in an Array
You are viewing a single comment's thread. Return to all comments →
c++ solution:-