JBCconnect Interview Question

JS advance problem solving question