Answer: SCHNEIDER ELECTRIC INDIA Hiring | Off-Campus OA (2024) | Strings
Answer · Posted Jun 2026
Approach Store all vowels in a string. Divide the input string into two equal halves. Count the number of vowels in the first half. Count the number of vowels in the second half. Compare both counts. Return true if they are equal; otherwise false. Strategy Compute the middle index of the string. Traverse the first half and count vowels. Traverse the second half and count vowels. Compare both counts to determine whether the halves are alike. Java Code class Solution ...
The full answer & interview discussion are available to premium members.
Log in Create a free account