SCHNEIDER ELECTRIC INDIA Hiring | Off-Campus OA (2024) | Strings
Question · Posted Jun 2026
Q1: Determine if String Halves Are Alike Problem Statement You are given an even-length string s. Divide the string into two equal halves. Two halves are considered alike if they contain the same number of vowels. Vowels are: a, e, i, o, u Both uppercase and lowercase letters are considered vowels. Return true if both halves are alike; otherwise, return false. Example Input s = "MerryChristmas" Output false Explanation First Half: "MerryCh" → Vowels = 1 (e) Second Half: "ristmas" ...
The full answer & interview discussion are available to premium members.
Log in Create a free account