CSE 101 Homework Assignment 9 File Edit View Insert Runtime Tool Help Changa.wl.nolbe.ed gpo Part 1: Uwuify a Sentence (8 points) A uwuified sentence is a sentence that has been transformed using a made-up Internet language in which some of the letters in the words are replaced by something else. The exact scheme is described below:
If we encounter an o/o in a word, check if the previous letter, if it exists, is an m or n. If the previous letter is one of these, insert the lowercase letter y in between them, regardless of the capitalization of the other letters.
All other characters are left unchanged.
Some examples:
- "Professor" will be converted to "Pvofessow" (There are two r's that are replaced by v's. Since the two o's aren't preceded by an n or m, no y will be inserted).
- "university" will be converted to "yunivewsity" (The first o will have a y inserted before it because it is preceded by an m).
Write the function "uwuifysentence" which takes in a sentence stored in the argument named "sentence" and then uwuifies the string according to the scheme described above.
Examples:
- Return Value: "Hello, World! This is my sentence." -> "Hewwo, Wowld! This is my sentence."
- Return Value: "I love ice cream." -> "I wove ice cweam.