Samsung Electronics interview question

basic question on arrays and trees