func_code_string: #include <bits/stdc++.h>   int const MAX = 1e5 + 5;   int a[MAX], need[MAX];   bool has[MAX], pos[MAX];   int main() {     int n, num = 0;     scanf( %d , &n);     memset(has, false, sizeof(has));     memset(pos, false, sizeof(pos));     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);       if (!has[a[i]] && a[i] <= n)         has[a[i]] = true;       else         pos[i] = true;     }     int cnt = 0;     for (int i = 1; i <= n; i++)       if (!has[i]) need[cnt++] = i;     int idx = 0;     for (int i = 0; i < n; i++)       if (pos[i]) a[i] = need[idx++];     for (int i = 0; i < n - 1; i++) printf( %d  , a[i]);     printf( %d n , a[n - 1]);   }   