Making a Rainbow
InterviewTime limit1sMemory limit1024 MB
Given a string of letters, decide whether it has enough lowercase, uppercase, or both to spell ROYGBIV, then print yes, YES, YeS, or NO!.
- Level
Easy2 of 10
- Topics
- String, Implementation
- Solved
- No attempts yet
Problem

A rainbow string is made of R (red), O (orange), Y (yellow), G (green), B (blue), I (indigo), and V (violet), in that order. Letter case is ignored.
Ims gives Chunbae a string of English letters, both uppercase and lowercase. Ims asks whether the letters in that string can form a rainbow string.
Given the length of the string Ims gave Chunbae and the string itself, print yes if a rainbow can be written in lowercase letters only, YES if a rainbow can be written in uppercase letters only, YeS if both are possible, and NO! if neither is possible.
Input
The first line contains the length of the string Ims gave Chunbae.
The second line contains the string Ims gave Chunbae.
Output
Print whether the string Ims gave Chunbae can be used to make a rainbow string.