common.c (197B)
1 #include "common.h" 2 3 int pairwise_diff(char *s, size_t n) { 4 int i, j; 5 6 for (i = n - 2; i >= 0; i--) 7 for (j = i + 1; j < n; j++) 8 if (s[i] == s[j]) 9 return i + 1; 10 11 return 0; 12 }
aocc22Advent of Code 2022 | |
| git clone git://www.tkruger.se/aocc22.git | |
| Log | Files | Refs | README |