Intel Corporation interview question

optimization of algorithms, codes sometimes are bit challenging