Turing interview question

He asked me to solve 1 medium level DSA question in python