EY Interview Question

Core java questions, easy leetcode task about two sum