19 lines
442 B
C
19 lines
442 B
C
|
#include <stdio.h>
|
||
|
#include "boilerplate.h"
|
||
|
|
||
|
int compare(const void * a, const void * b) {
|
||
|
return ((signature *)a)->sign - ((signature *)b)->sign;
|
||
|
}
|
||
|
|
||
|
uint32_t getsig(char * word) {
|
||
|
uint32_t result = 0;
|
||
|
for (uint32_t i = 0; i < 5; i++) {
|
||
|
uint32_t bit = 1u << (word[i] & CHARMASK);
|
||
|
if (result & bit) {
|
||
|
// duplicate letters
|
||
|
return 0;
|
||
|
}
|
||
|
result |= bit;
|
||
|
}
|
||
|
return result;
|
||
|
}
|