Can somebody recommend a algorithm for 'fast' wildcard case insensitive string comparisons?
The wild cards are '*' and '?'
Thanks
Can somebody recommend a algorithm for 'fast' wildcard case insensitive string comparisons?
The wild cards are '*' and '?'
Thanks
Did you just ask us how to solve the contest?
http://cboard.cprogramming.com/showthread.php?t=36704
Someone close this thread please.
Yeah, but it's better than bumping a 3 year old thread which was abandoned by the contest organiser....
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
What does * and ? do? Last I heard, they are both used to censor words spoken after lots of beer...
You need to lay out requirements more specifically. Like, are multichar wildcards greedy?
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}