Soliton Technologies Interview Question

Problem soving using DSA using python code.