Modify String

3.5

11 votes
Problem

Write a program that takes a string as input and modifies it using below properties :

  1. If the letter in string is upper case letter, replace that letter with a string containing every letter from A to that letter.For example, if the input letter is H , then the output would be ABCDEFGH.
  2. If the letter in string is lower case letter, replace that letter with a string containing every letter from a to that letter.For example, if the input letter is h , then the output would be abcdefgh.
  3. If letter in string is number(0-9), replace that letter with a string containing numbers from 0 to that number. For example, if input letter is 3 , then the output would be 0123 .
  4. All other characters are printed without modification.
Time Limit: 2
Memory Limit: 256
Source Limit:
Explanation

Self Explainatory.

Editor Image

?