Calculate the mean of each half of a matrix
Given a matrix with an even number of columns, n, return a 1-by-2 row vector where the first element is the mean of all the elem...
4ヶ月 前
解決済み
Find Closest Constant
Given a number x, return the value that is closest to x from this list of constants: 0, 1, , e, , (also known as ).
For exampl...
4ヶ月 前
解決済み
Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...
4ヶ月 前
解決済み
Dimensions of a rectangle
The longer side of a rectangle is three times the length of the shorter side. If the length of the diagonal is x, find the width...
4ヶ月 前
解決済み
Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x.
<<https://i.imgur.com/jlZDHhq.png>>
Image courtesy of <http://up...
4ヶ月 前
解決済み
Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x?
<<https://i.imgur.com/jlZDHhq.png>>
...
Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58.
A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...