Intel Corporation Interview Question

optimization of algorithms, codes sometimes are bit challenging