0% found this document useful (0 votes)
19 views1 page

Speed Programming Challenges

The document contains two programming problems. The first problem involves changing the case of all letters in a string from uppercase to lowercase or vice versa. The second problem checks if a vehicle license tag is valid by determining if the sum of every two consecutive digits is even and the letter is not a vowel.

Uploaded by

FAYYAZ KHAN
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views1 page

Speed Programming Challenges

The document contains two programming problems. The first problem involves changing the case of all letters in a string from uppercase to lowercase or vice versa. The second problem checks if a vehicle license tag is valid by determining if the sum of every two consecutive digits is even and the letter is not a vowel.

Uploaded by

FAYYAZ KHAN
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Speed Programming (Round II)

Problem # 1

You have been given a String S consisting of uppercase and lowercase English alphabets. You need to
change the case of each alphabet in this String. That is, all the uppercase letters should be converted
to lowercase and all the lowercase letters should be converted to uppercase. You need to then print
the resultant String to output.

Input Format
The first and only line of input contains the String S

Constraints
1≤|S|≤100 where S denotes the length of string S.

Output Format
Print the resultant String on a single line.

Problem # 2

Arpasland has surrounded by attackers. A truck enters the city. The driver claims the load is food and
medicine from Iranians. Ali is one of the soldiers in Arpasland. He doubts about the truck, maybe it's
from the siege. He knows that a tag is valid if the sum of every two consecutive digits of it is even
and its letter is not a vowel. Determine if the tag of the truck is valid or not.

We consider the letters "A","E","I","O","U","Y" to be vowels for this problem.

Input Format

The first line contains a string of length 9. The format is "DDXDDD-DD", where D stands for a digit
(non zero) and X is an uppercase English letter.

Output Format

Print "valid" (without quotes) if the tag is valid, print "invalid" otherwise (without quotes)

You might also like