Bending Spoons interview question

Logic quiz and some algorithms