PEPPER CONTENT Off-Campus OA (2025) | Problem Reverse Vowels of a String
Question · Posted Jun 2026
Problem Statement Given a string s, reverse only the vowels in the string and return the resulting string. The vowels are: a, e, i, o, u, A, E, I, O, U All non-vowel characters should remain in their original positions. Example 1 Input s = "IceCreAm" Output AceCreIm Explanation Vowels in order: I, e, A Reversed: A, e, I Result: AceCreIm Example 2 Input s = "hello" Output holle
The full answer & interview discussion are available to premium members.
Log in Create a free account