From a54c259eedb78455f96c32df13bb1ab549fc0272 Mon Sep 17 00:00:00 2001 From: AbhishekYMCA <33192447+AbhishekYMCA@users.noreply.github.com> Date: Sun, 29 Oct 2017 12:01:38 +0530 Subject: [PATCH] Create Mex --- Mex | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Mex diff --git a/Mex b/Mex new file mode 100644 index 0000000..067e7ea --- /dev/null +++ b/Mex @@ -0,0 +1,27 @@ +#include +using namespace std; +int main() +{ + ios_base::sync_with_stdio(false); + long int t; + cin>>t; + while(t--) + { + long long int n,k,i=0; + cin>>n>>k; + long long int num,h[200005]={0}; + for(i=0;i>num; + h[num]++; + } + i=0; + while(k>=0) + { + if(!h[i]) + k--; + i++; + } + cout<