Nice, thx.
Could golf slightly further I suppose to:
perl -e '/(\d+)$/and$t[$1]=1for<*>;while($c<$#t){$t[++$c]||print "$c "}'
I like that since it seems quite readable as well (at least for me)
Though is map more efficient than while?
Comment on Re^2: one-line split file sequence checker