Lets say I have a computer program below.
(define (factorial x) (if (= x 0) 1 (else (* x (factorial (- x 1)))))
I then take each line of the program and create a random permutation.
1 (if (= x 0) (else (* x (factorial (- x 1))))) (define (factorial x)
Now I give you a set of valid values that the program must return. 1,2,6,24
Your task is to sort the permutations of the program until it gives you the result.
Is this a new problem? I haven't found anything remotely like the problem I proposed above.
What is the runtime to solving this problem?