Back to basics 22 - Rotate a matrix
Covering some basic topics I haven't seen elsewhere on Cody.
Rotate the input matrix 90 degrees counterclockwise (e.g. [1 2; ...
約4年 前
解決済み
Duplicate each element of a vector.
for an n-dimensional vector x, the function should return another vector 2n-dimension which each element is repeated twice.
Ex...
Rotate Matrix Depending on the input
Rotate matrix (CounterClockwise) via 90, 180 or -90 depending on the input
Ex. a = [1 2 3;
4 5 6;
7 8 9]
b = 90;
...
約4年 前
解決済み
Area of a triangle
A triangle is given with base *'b'* ,vertical hight *'h'* . then find it's area.
約4年 前
解決済み
Area of a Square
Inside a square is a circle with radius r.
What is the area of the square?
約4年 前
解決済み
Sum of diagonal of a square matrix
If
x = [1 2 4; 3 4 5; 5 6 7]
then y should be the sum of the diagonals of the matrix
y = 1 + 4 + 7 = 12
Wheat on a chessboard pt 2
If a chessboard were to have wheat placed upon each square such that x grains were placed on the first square and each successiv...
約4年 前
解決済み
Wheat on a chessboard pt 1
If a chessboard were to have wheat placed upon each square such that one grain were placed on the first square and each successi...
約4年 前
解決済み
Find the Best Hotels
Given three input variables:
* |hotels| - a list of hotel names
* |ratings| - their ratings in a city
* |cutoff| - the rat...
約4年 前
解決済み
Is the Point in a Circle?
Check whether a point or multiple points is/are in a circle centered at point (x0, y0) with radius r.
Points = [x, y];
c...