advent-of-code/2021/day01/day01_golf.c
2024-11-12 21:46:18 +01:00

7 lines
137 B
C

b[5000],p,q,n,i;
main(){
for(;~scanf("%d",b+n++););
for(i=n-2;i--;)p+=b[i+1]>b[i];
for(i=n-4;i--;)q+=b[i+3]>b[i];
printf("%d %d",p,q);
}