Skip to main content
Back to problems
Codeforces
Easy
Arrays
Strings
Simulation
Text Volume

Count the number of vowels in each word and compare the total text volume across two strings.

Acceptance 0%
Problem Statement

Problem

You are given two text strings. For each string, define its volume as the total number of vowels it contains, where vowels are a, e, i, o, u in either lowercase or uppercase.

Your task is to determine which string has the larger volume.

If the first string has a larger volume, print 1. If the second string has a larger volume, print 2. If both volumes are equal, print 0.

Notes

  • Only English vowels count.
  • All other characters are ignored.
  • The comparison is based on total vowel count, not length or number of words.

Input Format

  • The first line contains a string ss.
  • The second line contains a string tt.

Output Format

Print a single integer:

  • 1 if ss has more vowels,
  • 2 if tt has more vowels,
  • 0 if they are equal.

Constraints

  • Strings may contain letters, spaces, and punctuation.
  • Comparison is case-insensitive for vowels.
  • A simple linear scan is sufficient.
Examples
Sample cases returned by the problem API.

Example 1

Input

Hello
Codeforces

Output

2

Explanation

Hello has 2 vowels (e, o), while Codeforces has 4 vowels (o, e, o, e).

Example 2

Input

AE
ui

Output

0

Explanation

Each string contains 2 vowels, so the result is a tie.

Premium problem context

Unlock deeper context for this problem

Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.

Guided hints
Editorial and discussion links
Concept map and variants
Sign in to unlock
Track your progress
Sign in to bookmark this problem, save notes, and manage its revision plan.