From 378828e25342e038d6f8aeeab4c9a5aad899c169 Mon Sep 17 00:00:00 2001 From: James Smith Date: Sun, 8 May 2022 01:10:44 +0100 Subject: Update README.md --- challenge-163/james-smith/README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'challenge-163') diff --git a/challenge-163/james-smith/README.md b/challenge-163/james-smith/README.md index e278943aa3..8922aac730 100644 --- a/challenge-163/james-smith/README.md +++ b/challenge-163/james-smith/README.md @@ -75,11 +75,10 @@ the most natural way of executing the code - in fact it doesn't matter which way also use `pop` which is two bytes shorter.. ```perl -#--------1---------2---------3---------4---------5---------6---------7---------8---------9 -#23456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 - -sub bsm{$a=0;%^H=map{$_,1}@_;@_=map{$_+0}keys%^H;$b=pop,map{$a+=$b&$_}@_ while@_;$a} ## 84 chars -sub bsu{$a=0;@_=map{$_+0}@_;$b=pop,map{$a+=$b&$_}@_ while@_;$a} ## 63 chars +#--------1---------2---------3---------4---------5---------6---------7---------8 +#2345678901234567890123456789012345678901234567890123456789012345678901234567890 +sub bsm{$a=0;%^H=map{$_,1}@_;@_=keys%^H;$b=0+pop,map{$a+=$b&$_}@_ while@_;$a} ## 77 chars +sub bsu{$a=0;$b=pop,map{$a+=$b&$_}@_ while@_;$a} ## 48 chars ``` # Challenge 2 - Summations @@ -147,5 +146,4 @@ Below are code equivalent to the above - with all spaces removed - we use the sp ```perl #--------1---------2---------3---------4---------5 #2345678901234567890123456789012345678901234567890 - sub sum{shift,$a=0,@_=map{$a+=$_}@_ while@_>1;$a} ## 49 chars -- cgit