PowerSchool Group interview question

Some array related coding question