Skip to main content

Posts

Pangrams : Challenge

Problem Statement Roy wanted to increase his typing speed for programming contests. So, his friend advised him to type the sentence "The quick brown fox jumps over the lazy dog" repeatedly, because it is a   pangram . (Pangrams are sentences constructed by using every letter of the alphabet at least once.) After typing the sentence several times, Roy became bored with it. So he started to look for other pangrams. Given a sentence   s , tell Roy if it is a pangram or not. Input Format   Input consists of a line containing   s . Constraints   Length of   s   can be at most   10   ( 1 ≤ | s | ≤ 10 3 )   and it may contain spaces, lower case and upper case letters. Lower case and upper case instances of a letter are considered the same. Output Format   Output a line containing   pangram   if   s   is a pangram, otherwise output   not pangram . Sample Input #1 We promptly judged antique ivory b...

Funny String

Problem Statement Suppose you have a string   S   which has length   N   and is indexed from   0   to   N −1 . String   R   is the reverse of the string   S . The string   S   is funny if the condition   | S i − S i −1 |=| R i − R i −1 | is true for every   i   from   1   to   N −1 . (Note: Given a string   str ,   str i   denotes the ascii value of the   i th   character (0-indexed) of   str . |x| denotes the absolute value of an integer x) Input Format First line of the input will contain an integer   T .   T   testcases follow. Each of the next   T   lines contains one string   S . Constraints ·          1<= T <=10 ·          2<=length of  S <=10000 Output Format For each string, print   Funny   or   Not Fu...