Nagarro interview question

Basic question on data structure and algorithms