Oracle interview question

implement a leetcode algorithm about arrays