aboutsummaryrefslogtreecommitdiff
path: root/challenge-084/markus-holzer/raku/twitter
blob: 2ef28d946e5a11526a507ac3dd87ed6015900dca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
my $N = 100;
my @A[4,4] =
    < 1 1 0 1 >,
    < 1 1 0 0 >,
    < 0 1 1 1 >,
    < 1 0 1 1 >;
#84 solutions fit in a tweet
#1
say $N.abs <=2³¹??$N.subst(/\d+/,+*.flip)!!0;
#2
my ($h,$w)=@A.shape;
say +gather for [X] 0..^$h,0..^$w -> ($r,$c){
for $r^..^$h -> $R {
for $c^..^$w -> $C {
take 1 if @A[$R;$C]&@A[$R;$c]&@A[$r;$C]&@A[$r;$c]}}}