Virtusa interview question

Data structures and arrays from hacker rank