Apple interview question

Two Sum using different method