Tap here to switch tabs
Problem
Submissions

Problem: Determine if String Halves Are Alike

med
30 min
Try to solve the Determine if String Halves Are Alike problem.

Statement

You are given a string s of even length. Split this string into two halves of equal length, letting a be the first half and b be the second half.

Two strings are alike if they have the same number of vowels ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'). Notice that s contains both uppercase and lowercase English letters.

Return true if a and b are alike, or false otherwise.

Constraints:

  • 2≤2 \le s.length ≤1000\le 1000

  • s.length is even.

  • s consists of uppercase and lowercase letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Determine if String Halves Are Alike

med
30 min
Try to solve the Determine if String Halves Are Alike problem.

Statement

You are given a string s of even length. Split this string into two halves of equal length, letting a be the first half and b be the second half.

Two strings are alike if they have the same number of vowels ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'). Notice that s contains both uppercase and lowercase English letters.

Return true if a and b are alike, or false otherwise.

Constraints:

  • 2≤2 \le s.length ≤1000\le 1000

  • s.length is even.

  • s consists of uppercase and lowercase letters.