in reply to Better way of writing "find the missing number(s)"

Hello pritesh_ugrankar,

you got easier answers, pardon me for the following (long)oneliner:

perl -E "@sr=sort{$a<=>$b}@ar=(5..7,8,10,-3);map{$h{$_}++}$sr[0]..$sr[ +-1],@ar;say for grep{$h{$_}==1}sort{$a<=>$b} keys %h" -2 -1 0 1 2 3 4 9

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.
  • Comment on Re: Better way of writing "find the missing number(s)" -- oneliner
  • Download Code