Kredily interview question

Mostly on algorithm building using python