Skip to content

Strings

Sum of Numbers in a String Code C++

Sum of Numbers in a String

Today, I found a problem where we need to find the sum of numbers in a string, the string will be a mix of alphabets, numbers, and special characters, and usually, this can be solved by iterating through each character and adding all the numbers. Example Solution Approach Given a… Read More »Sum of Numbers in a String

Program to Validate Username

Program to Validate Username

Today’s problem, write a program to validate username, similar to the Instagram username validation program, I came up with a simple solution in C++. The problem is very simple, we just need to take care of the rules and limits stated below. Conditions and Rules for Username Can contain Numbers… Read More »Program to Validate Username