IDZ Digital interview question

Classical jug problem, factorial recursive code