Easy Question On String Leetcode Questions Java