Freelancer Interview Question

Two Problem solving questions algorithm