Java Replace First Occurrence Leetcode 75