OCTO Technology Interview Question

resolve this psuedo code with recursive way.