Java String Replace First Occurrence Leetcode Problem 543045044