#C12300. Vowel Indices Sum

    ID: 41713 Type: Default 1000ms 256MiB

Vowel Indices Sum

Vowel Indices Sum

In this problem, you are given a string s. Your task is to compute, for each vowel present in s, the sum of all the indices (0-indexed) at which that vowel appears. Note that the string is processed in a case-insensitive manner, meaning that uppercase and lowercase letters are considered identical.

For example, consider the string "Hello World":

  • The vowel 'e' appears at index 1.
  • The vowel 'o' appears at indices 4 and 7, and their sum is 11.

Thus the output should be: {'e': 1, 'o': 11}.

If no vowels are found, print an empty dictionary: {}.

All formulas if needed (e.g. the sum for a vowel v) is given by: [ S(v) = \sum_{i \in I(v)} i ] where (I(v)) is the set of indices at which vowel (v) appears.

inputFormat

The input consists of a single line containing the string s. The string may contain spaces and both uppercase and lowercase letters.

outputFormat

Print the dictionary that maps each vowel (in lowercase) found in s to the sum of its indices. The dictionary should be printed in the format similar to Python's dictionary literal, with keys enclosed in single quotes and entries separated by commas. If no vowels are present, print {}.## sample

Hello World
{'e': 1, 'o': 11}