Samsung Electronics Interview Question

make code review of algorithm code