Publicis Sapient interview question

Discussion on a solution to the coding problem