Oracle interview question

Optimize time and memory complexity for some algorithm