Vahak interview question

problem solving, array, Java collection