coldy has asked for the wisdom of the Perl Monks concerning the following question:
eg , @a_indices = (1,3,5)
If I know the size of @b, is there an easy way to determine the complementary positions?
eg if $b = 10 what are the positions that are not @a.
I was thinking I could create an array of indices
and then find the non-intersecting elements with @a_indices. Surely there must be an easier way? Thanks.@b_indices = (0..9)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: complementary array indices
by almut (Canon) on May 11, 2009 at 01:04 UTC | |
|
Re: complementary array indices
by GrandFather (Saint) on May 11, 2009 at 01:33 UTC | |
by tilly (Archbishop) on May 11, 2009 at 18:29 UTC | |
|
Re: complementary array indices
by ig (Vicar) on May 11, 2009 at 05:31 UTC | |
|
Re: complementary array indices
by Anonymous Monk on May 11, 2009 at 00:55 UTC | |
|
Re: complementary array indices
by Marshall (Canon) on May 11, 2009 at 09:08 UTC | |
|
Re: complementary array indices (5.10)
by lodin (Hermit) on May 12, 2009 at 00:07 UTC | |
|
Re: complementary array indices
by rir (Vicar) on May 12, 2009 at 17:30 UTC |