in reply to Better way of writing "find the missing number(s)"
Numbers 1..n, one missing.
#! /usr/bin/perl -wl use List::Util qw( sum ); my @arr = (1..3,5..7); print +- sum -1-@arr .. -1,@arr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find the missing number
by pryrt (Abbot) on Apr 04, 2017 at 18:31 UTC | |
|
Re^2: Find the missing number
by prysmatik (Sexton) on Apr 04, 2017 at 20:41 UTC | |
by AnomalousMonk (Archbishop) on Apr 04, 2017 at 23:06 UTC | |
by prysmatik (Sexton) on Apr 05, 2017 at 12:05 UTC |