Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Locate missing number in a series

by stevieb (Canon)
on Apr 21, 2016 at 19:05 UTC ( [id://1161141]=note: print w/replies, xml ) Need Help??


in reply to Locate missing number in a series

You could put your entire locker list into an array, put the leased lockers that you harvested from the DB into a hash, then generate a new array for locker numbers that have not been leased.

use warnings; use strict; my @lockers = (1..25); my %leased = map {$_ => 1} (1..12, 14..25); my @avail = grep {! defined $leased{$_}} @lockers; print "$_\n" for @avail; __END__ 13

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1161141]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (7)
As of 2024-04-24 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found