leetcode wriiten in java