Back to problems

Pig Latin Sentence Converter

Algorithm · Square · Medium

(This problem is a variant of LeetCode's Goat Latin. If you haven't solved that one yet, solving it first is recommended.) You are building a "Pig Latin" translation tool. You receive a string sentence whose words are delimited by single spaces. Your job is to convert every word into its Pig Latin form and return the newly constructed sentence. Apply these exact per-word rules during the transformation: Starts with a vowel ('a', 'e', 'i', 'o', 'u' — casing does not matter):…

Checking your access…