Problems > Alternating Caps

Alternating Caps

Difficulty: 800 2000 ms 128 MB

strings

Uppercase the characters at even positions (0-based) and leave odd positions lowercase.

Input: one line with the string S.

Output: S with even-indexed characters uppercased.

Constraints:

  • 1 ≤ |S| ≤ 104
  • S contains lowercase English letters

Sample Tests

Input 1
banana
Output 1
BaNaNa
Input 2
ab
Output 2
Ab

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.