Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by blakem (Monsignor)
on Sep 10, 2002 at 08:50 UTC ( #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
Node Status?
node history
Node Type: note [id://196584]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2019-05-23 19:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you enjoy 3D movies?



    Results (146 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!