This page is still under construction.

Parts of this page are still being built. What you see may change.

Find the Alphabet

Interview

Time limit1sMemory limit256 MB

Summary
Given a lowercase word of length at most 100, output the 0-based first index of each letter a to z, or -1 when absent.
Level

Easy1 of 10

Topics
Array, String
Solved
No attempts yet

Problem

You are given a word SS consisting of lowercase English letters. For every letter from a to z, print the index of its first appearance in SS, or -1 if it does not appear.

Input

One line with word SS. The length is at most 100100 and every character is a lowercase letter.

Output

Print 2626 integers separated by spaces: the first index of a, then b, through z. Positions are 00-based.

Examples4

  1. Example 1

    Input
    baekjoon
    
    Expected output
    1 0 -1 -1 2 -1 -1 -1 -1 4 3 -1 -1 7 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
    
  2. Example 2

    Input
    abcdefghijklmnopqrstuvwxyz
    
    Expected output
    0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
    
  3. Example 3

    Input
    z
    
    Expected output
    -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0
    
  4. Example 4

    Input
    aaa
    
    Expected output
    0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1