Akuna Interview Question

Code about factor a integer, probabilities, etc.