TCS Interview Question

Oops concept basic loops,dsa,time complexity