π Day 11 β Teacher's Day Challenge | String Task


ποΈ Date: August 04, 2025
π§© Platform: Codeforces
π’ Problems Solved Today: 1
π― Focus Topic: Strings, Character Filtering, Case Handling
π Table of Contents
Daily Summary
π§© Problem 1 β String Task
π Difficulty: Easy
π§ Concepts: Character Iteration, Lowercasing, Vowel Removal, String Building
π Problem Statement (Summary):
Given a string with uppercase and lowercase Latin letters, perform the following:
Remove all vowels (
A, O, Y, E, U, I
and lowercase variants).Convert all uppercase consonants to lowercase.
Insert
.
before every consonant that remains.
Output the final processed string.
Examples:
Input: tour
β Output: .t.r
Input: Codeforces
β Output: .c.d.f.r.c.s
Input: aBAcAba
β Output: .b.c.b
π‘ Approach:
Read input string.
Iterate through each character:
Convert it to lowercase.
Skip if itβs a vowel.
Otherwise, append
"." + character"
to result.
Print final result.
π§ͺ Code (C++):
#include <iostream>
#include <string>
#include <cctype>
#include <algorithm>
using namespace std;
int main()
{
string str, result;
cin >> str;
for (char ch : str)
{
ch = tolower(ch);
if (ch == 'a' || ch == 'o' || ch == 'y' || ch == 'e' || ch == 'u' || ch == 'i')
continue;
result += ".";
result += ch;
}
cout << result;
return 0;
}
πΈ Submission Screenshot:
β Key Takeaways:
tolower()
simplifies case normalization.Filtering is easy using
continue
in loops.Vowels are explicitly checked; all others are treated as consonants.
Concatenating strings in loops is fine for small input sizes.
π Daily Summary
Metric | Value |
Problems Solved | 1 |
Topics Covered | Strings, Case Handling |
Tools Used | C++ |
Next Focus | Frequency Maps, String Arrays |
Day | 11 / 30 |
π·οΈ Tags:#codeforces #strings #tolower #filtering #cpp #dsa #43DaysChallenge
Subscribe to my newsletter
Read articles from Tanishi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
