تابعی بنویسید که تمام کلمات یک جمله را که با حرف خاصی شروع میشوند، معکوس کند.
نمونه ورودی و خروجی
SpecialReverse("word searches are super fun", "s") ➞ "word sehcraes are repus fun"
SpecialReverse("first man to walk on the moon", "m") ➞ "first nam to walk on the noom"
SpecialReverse("peter piper picked pickled peppers", "p") ➞ "retep repip dekcip delkcip sreppep"
نکات
- فقط کلماتی که با حرف مشخصشده شروع میشوند، معکوس شوند.
- کل جمله معکوس نشود، فقط کلمات مربوطه معکوس شوند.
- تمام کاراکترهای جمله با حروف کوچک نوشته شدهاند.
SpecialReverse("word searches are super fun", "s") ➞ "word sehcraes are repus fun"
SpecialReverse("first man to walk on the moon", "m") ➞ "first nam to walk on the noom"
SpecialReverse("peter piper picked pickled peppers", "p") ➞ "retep repip dekcip delkcip sreppep"
نظرات