aboutsummaryrefslogtreecommitdiff
path: root/challenge-201/deadmarshal/d/ch1.d
blob: bf2485ee336a17c45d03b53c62bb87ee49e70483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import std.stdio:write,writeln;

void missing_numbers(int[] arr)
{
  int[int] m;
  foreach(const ref i;arr) m[i] = i;
  for(int i = 0; i <= arr.length; ++i)
    if(i !in m) write(i, ' ');
  writeln;
}

void main()
{
  missing_numbers([0,1,3]);
  missing_numbers([0,1]);
}