Skip to content

C++

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