Numbers spiral diagonals (Part 2)
Inspired by Project Euler n°28 and 58.
A n x n spiral matrix is obtained by starting with the number 1 and moving to the right ...
Remove a specific character with another
Remove any (-) dash sign with (_) underscore
Ex = 'The-Journey-of-thoudsands-miles-starts-with-a-single-step'
y = 'The_Jour...
1 year ago
Solved
Swap between first and last
The idea is to swap between first and last row
Ex = [1 2 3 4 5;
1 2 3 4 5;
1 2 3 4 5;
1 2 3 4 5;
...
1 year ago
Solved
Swap between first and last column
The idea is to swap between first and last column
Ex = [1 2 3 4 5;
1 2 3 4 5;
1 2 3 4 5;
1 2 3 4 5;
1 2 3 ...
1 year ago
Solved
Flipping
Write code that can reverse the vector without using any sort of loop.
Example
Given the input vector
A = [ 1 2 3 4 5...
1 year ago
Solved
Swap two numbers
Example
Input:
a = 10
b = 20
Output
a = 20
b = 10
1 year ago
Solved
Flipping a Matrix
Flipping matrix up and down.
If a central row is exists, leave it, and flip remaining rows.
Example
Mat = magic(3)
...