EY interview question

Core java questions, easy leetcode task about two sum