Netaş interview question

Problems solving