Publicis Sapient interview question

some puzzles