Challenge D3

Deutch-Jozsa algorithm.
You need to login to be able to submit solutions!

You have to implement the Deutsch-Jozsa algorithm which determines whether a given oracle function is constant or balanced:

If the oracle function is constant it returns 0 or 1 on all inputs.

If the oracle function is balanced it returns 0 on half of the inputs and 1 on the other half.

The oracle function is assumed to always be constant or balanced.

Implement the Solve operation where n is the number of bits in the input register and oracle provides you with the oracle function that takes an input register and and output bit.

The solve operation should return true if the oracle function is constant and false if it is balanced.

An unhandled error has occurred. Reload 🗙