SHARE
TWEET

Untitled

a guest Sep 23rd, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int interval(int a[],int n)
  2. {
  3.     int i,cnt=2;
  4.     if(a[0]>a[n-1])
  5.     swap(a[0],a[n-1]);
  6.     for(i=1;i<n-1;i++)
  7.         if(a[i]>=a[0]&&a[i]<=a[n-1])
  8.             cnt++;
  9.     return cnt;
  10. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top