A problem that teaches palindrome detection using string comparison and case-insensitive analysis.
A palindrome is a word, phrase, or sequence that reads the same forward and backward. Write a program that checks whether a given string is a palindrome or not. For this basic version, consider only alphabetic characters and ignore case sensitivity. Return true
if the string is a palindrome, false
otherwise.
Your task: Check if a string is a palindrome (case-insensitive, alphabetic characters only).
Input:
"racecar"
Output:
true
Input:
"hello"
Output:
false
Input:
"Madam"
Output:
true
A problem that teaches character classification and frequency analysis in text processing.
Write a program that takes a string as input and counts the number of vowels (a, e, i, o, u) and consonants separately. Consider both uppercase and lowercase letters. Ignore any non-alphabetic characters like numbers, spaces, or special symbols.
This helps in text analysis and understanding the composition of words.
Your task: Count vowels and consonants separately, ignoring non-alphabetic characters.
Input:
"hello"
Output:
Vowels: 2, Consonants: 3
Input:
"Programming"
Output:
Vowels: 3, Consonants: 8
Input:
"aeiou"
Output:
Vowels: 5, Consonants: 0
A problem that combines character frequency analysis with string traversal techniques.
Given a string, find the first character that appears only once in the string. If all characters repeat or the string is empty, return a special indicator like -1
or None
.
This problem is commonly used in interviews and helps understand character frequency analysis and string traversal techniques.
Your task: Find the first character that appears only once, or return -1 if none exists.
Input:
"programming"
Output:
'p'
Input:
"aabbcc"
Output:
-1
Input:
"abccba"
Output:
-1