SHARE
TWEET

Kth

a guest Nov 14th, 2019 114 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int Kth(int a[],int n,int x,int k)
  2. {
  3.     if(k==0)
  4.         return -1;
  5.     for(int i=0;i<n;++i)
  6.     {
  7.         if(x==a[i])
  8.             --k;
  9.         if(k==0)
  10.             return i;
  11.     }
  12.     return -1;
  13. }
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