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

Re^3: Generate all unique combinations of 1 and 0 using specified length of "0"-string and count of 1's -- permutations

by choroba (Cardinal)
on Sep 18, 2020 at 09:12 UTC ( #11121904=note: print w/replies, xml ) Need Help??


in reply to Re^2: Generate all unique combinations of 1 and 0 using specified length of "0"-string and count of 1's -- permutations
in thread Generate all unique combinations of 1 and 0 using specified length of "0"-string and count of 1's

It returns far more results than needed, as they are repeated, because for permutations, zero at position 0 is different to zero at position 1.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
  • Comment on Re^3: Generate all unique combinations of 1 and 0 using specified length of "0"-string and count of 1's -- permutations
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2022-12-09 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?