We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 570ad95 commit d215264Copy full SHA for d215264
04.az.min.sh
@@ -0,0 +1,18 @@
1
+#!/bin/sh
2
+
3
+cat $1 | tr -d '|' | nl | sort -nr | cut -f2- |
4
+awk -vn=`awk 'END{print NR}' $1` '
5
+ {
6
+ m=p=0
7
+ for(i=3;i<=NF;i++) c[$i]+=1
8
+ for(k in c) if(c[k]>1) m+=1
9
+ delete c
10
+ if(m>0)p=2^(m-1)
11
+ s+=p
12
+ i=n-NR+1
13
+ for(j=1;j<=m;j++)w[i]+=(w[i+j]+1)
14
+ } END {
15
+ for(i=1;i<=n;i++)t+=(w[i]+1)
16
+ print s "," t
17
+ }
18
+'
04.az.sh
@@ -20,7 +20,7 @@ cat "$1" | tr -d '|' | nl | sort -nr | cut -f2- | awk -vnc=$nc '
20
21
END {
22
for (i = 1; i <= nc; i++) {
23
- totalCards += (wins[i] + 1);
+ totalCards += (wins[i] + 1)
24
}
25
print score "," totalCards
26
0 commit comments