in reply to Speeding permutation counting
Or should the result be 01=3x, 10=1x, 00=2x ?#!/usr/bin/perl -w use strict; use Smart::Comments '###'; my $report ={}; my @strings = qw( 0101 0001 ); for (@strings){ my $string = $_; $report->{$_}++ for $string=~/../g; } ### $report ### should be ### 01 3 ### 00 1
|
|---|