Today I solved this puzzle, which was an interview question at one of the companies around here, and it was a fun one. I figured I’d share it here too, in case anyone’s itching for a challenge!
P.S. 1: If you solve it, I’d love to hear your answer.
P.S. 2: Anything goes, even AI!
total available time: 24H
estimated time required: 1H
// Solve the puzzle.
// The answer is an single english word/phrase.
#define A(x) <B(x)>
#define B(x) x.h
#define C(x,y) D(x,y)
#define D(x,y) x ## y
#define E C(G,H)
#define F C(G,J)
#define G ???
#define H ??
#define I ????
#define J ????
#define K ???
#define L ???
#define M ??????
#define N ??????
#define O ????
#define P ??
#define Q ??????
#define R ?????
#define S ????
#define T ????
#include A(E)
#include A(F)
#include A(I)
R O O K n[]={442519980697,-648958014358109,64864750868537,-228065488292773,634588040579,-859048156117,17355913261,-419603777,10784621,-693533};
R O O K d[]={496215720,764172208800,191043052200,3056688835200,63681017400,1018896278400,382086104400,277880803200,382086104400,3056688835200};
J f(K y,K x){
Q s=1;
O O K z=1;
L(K i=0;i<10;i++){
z*=x;
s+=(Q)n[i]*z/d[i];
}
M S(s-y)<0.0001;
}
K main(){
K a[]={70,82,79,69,82,68,87,71,72,82,73,69,76,69,69,78,'?',66,'?',76,'?',85,'?',69};
K z=0;
L(K i=0;i<N(a)/N(a[0])-1;i++){
R J y=f(a[i+1]-65,a[i]-65);
P(!(a[i]-63)){
putchar('?');
z=1;
}
T P(y){
putchar(a[i+1]);
i++;
}
}
M z;
}