Superbet interview question

Write pseudocode, review a function