</>OfferRetriever
DashboardDiscuss
NEW

Spring Hire Sale

Limited Time Deal: Unlock all premium questions for over 30% off

$10.42$7.08

08

:

03

:

07

:

06

Get this deal
Back to Dashboard

[CodeSignal] Vowel Enclosed Reversal

Easy

You are given an array of strings text. For each word that starts and ends with a vowel (case-insensitive: a, e, i, o, u), reverse the substring between its first and last character, keeping the first and last characters in place. Words that do not start and end with a vowel remain unchanged.

A word of length 1 or 2 that starts and ends with a vowel has no middle characters to reverse and is returned unchanged. ...