Jio interview question

L2 - Couple of coding problems.