Siemens Interview Question

Technical coding round on Hackerrank