Java String Replace First Occurrence Leetcode 75 Sort