Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re2: (OT) Interview questions -- your response?

by blakem (Monsignor)
on Sep 10, 2002 at 08:50 UTC ( [id://196584]=note: print w/replies, xml ) Need Help??


in reply to Re: (OT) Interview questions -- your response?
in thread (OT) Interview questions -- your response?

If we hash either, a or b, we always will lose something
Take another look at Abigail-II's solution and note that the question specifically states that the order of the results is unimportant.
#!/usr/bin/perl -wT use strict; my @a_array = qw( a c f r f z t ); my @b_array = qw( e c s f r f) ; my %b_hash; $b_hash {$_} ++ for @b_array; my @c_array = map {($_) x ($b_hash {$_} || 0)} @a_array; print "@c_array\n"; __END__ c f f r f f

-Blake

Replies are listed 'Best First'.
Re: Re2: (OT) Interview questions -- your response?
by seeken (Novice) on Sep 14, 2002 at 05:04 UTC
    Well if there was one thing I should have learned in school, it was to read the danged question all the way through.

    surfing the net and other cliches....

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-23 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found