Skip to main content
added 761 characters in body
Source Link
gastropner
  • 4.4k
  • 1
  • 15
  • 20

C (gcc) pre-processor macro, 146 bytes

char*p="(3$,?2'+";D[]={0,5029,9169,17003,72042,136669,281564,444309,584847};	
#define E(x)D[strchr(p,*x^x[1])-p]
#define f(s,t)(E(t)-E(s))*10000LL

Try it online!

Another version, courtesy of ceilingcat, using Unicode, which seems to make TiO count weirdly:

C (gcc), 119 bytes

char*p="(3$,?2'+";
#define E(x)L"\0Ꭵ⏑䉫𑥪𡗝񄯜񬞕򎲏"[index(p,*x^x[1])-p]
#define f(s,t)(E(t)-E(s))*10000LL

Try it online!

C (gcc) pre-processor macro, 146 bytes

char*p="(3$,?2'+";D[]={0,5029,9169,17003,72042,136669,281564,444309,584847};	
#define E(x)D[strchr(p,*x^x[1])-p]
#define f(s,t)(E(t)-E(s))*10000LL

Try it online!

C (gcc) pre-processor macro, 146 bytes

char*p="(3$,?2'+";D[]={0,5029,9169,17003,72042,136669,281564,444309,584847};	
#define E(x)D[strchr(p,*x^x[1])-p]
#define f(s,t)(E(t)-E(s))*10000LL

Try it online!

Another version, courtesy of ceilingcat, using Unicode, which seems to make TiO count weirdly:

C (gcc), 119 bytes

char*p="(3$,?2'+";
#define E(x)L"\0Ꭵ⏑䉫𑥪𡗝񄯜񬞕򎲏"[index(p,*x^x[1])-p]
#define f(s,t)(E(t)-E(s))*10000LL

Try it online!

Source Link
gastropner
  • 4.4k
  • 1
  • 15
  • 20

C (gcc) pre-processor macro, 146 bytes

char*p="(3$,?2'+";D[]={0,5029,9169,17003,72042,136669,281564,444309,584847};	
#define E(x)D[strchr(p,*x^x[1])-p]
#define f(s,t)(E(t)-E(s))*10000LL

Try it online!