Solved Preferably Code In Python So It Can Be Simulated

Solved Preferably Code In Python So It Can Be Simulated