Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive).
If ch does not exist in word, return word unchanged.
Input: Two comma-separated values: string word and character ch.
Output: The modified string after reversing the prefix up to (and including) the first ch.
Input: abcdefd,d
Output: dcbaefd
Explanation: First 'd' at index 3; reverse word[0:4]='abcd' → 'dcba'; append 'efd' → 'dcbaefd'.Input: xyxzxe,z
Output: zxyxxe
Explanation: First 'z' at index 3; reverse word[0:4]='xyxz' → 'zxyx'; append 'xe' → 'zxyxxe'.Input: abcd,z
Output: abcd
Explanation: 'z' not found — return unchanged.1 <= word.length <= 250word consists of lowercase English lettersch is a lowercase English letter