Skip to content

Easy

matrix transpose c++

Transpose a Matrix

Given a matrix of N dimensions, and we need to transpose it. One of the standard problem on matrices. Don’t confuse Transpose with Rotation, the rotation is normally performed on the X-Y axis while in a transpose, the matrix is flipped on its diagonal. Example: Solution Approach This is simple… Read More »Transpose a Matrix

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