idealo internet interview question

Difficulty of some algorithms I coded