Infosys interview question

it was a python Coding question