Quadeye interview question

Programming questions - for the first one you can choose the programming language (python or c++). The second one was in c++