TCS interview question

Oops concept basic loops,dsa,time complexity