Solved


only input
Return the output without writing any code into the function.

meer dan 5 jaar ago

Solved


Is the input divisible by 3?
Return true if the input is divisible by 3 and false if not.

meer dan 5 jaar ago

Solved


Back and Forth Rows
Given a number n, create an n-by-n matrix in which the integers from 1 to n^2 wind back and forth along the rows as shown in the...

meer dan 5 jaar ago

Solved


The Goldbach Conjecture, Part 2
The <http://en.wikipedia.org/wiki/Goldbach's_conjecture Goldbach conjecture> asserts that every even integer greater than 2 can ...

meer dan 5 jaar ago

Solved


Most nonzero elements in row
Given the matrix a, return the index r of the row with the most nonzero elements. Assume there will always be exactly one row th...

meer dan 5 jaar ago

Solved


Bullseye Matrix
Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Exampl...

meer dan 5 jaar ago

Solved


Determine whether a vector is monotonically increasing
Return true if the elements of the input vector increase monotonically (i.e. each element is larger than the previous). Return f...

meer dan 5 jaar ago

Solved


Summing digits
Given n, find the sum of the digits that make up 2^n. Example: Input n = 7 Output b = 11 since 2^7 = 128, and 1 + ...

meer dan 5 jaar ago

Solved


Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...

meer dan 5 jaar ago

Solved


Make one big string out of two smaller strings
If you have two small strings, like 'a' and 'b', return them put together like 'ab'. 'a' and 'b' => 'ab' For extra ...

meer dan 5 jaar ago

Solved


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...

meer dan 5 jaar ago

Solved


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

meer dan 5 jaar ago

Solved


Side of an equilateral triangle
If an equilateral triangle has area A, then what is the length of each of its sides, x? <<http://upload.wikimedia.org/wikipe...

meer dan 5 jaar ago

Solved


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

meer dan 5 jaar ago

Solved


Right and wrong
Given a vector of lengths [a b c], determines whether a triangle with those sides lengths is a right triangle: <http://en.wikipe...

meer dan 5 jaar ago

Solved


inner product of two vectors
inner product of two vectors

meer dan 5 jaar ago

Solved


Length of a short side
Calculate the length of the short side, a, of a right-angled triangle with hypotenuse of length c, and other short side of lengt...

meer dan 5 jaar ago

Solved


Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
The given function returns the index of the maximum value in a given matrix. such as X=[4,3,4,5,9,12,0,5] Ans= 6 if maxim...

meer dan 5 jaar ago

Solved


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

meer dan 5 jaar ago

Solved


Compute a dot product of two vectors x and y
x and y are input vectors, d is a number and contains their dot product

meer dan 5 jaar ago

Solved


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

meer dan 5 jaar ago

Solved


Area of an equilateral triangle
Calculate the area of an equilateral triangle of side x. <<http://upload.wikimedia.org/wikipedia/commons/e/e0/Equilateral-tr...

meer dan 5 jaar ago

Solved


multiply by three
Given the variable x as your input, multiply it by 3 and put the result equal to y. Examples: Input x = 2 Output y is ...

meer dan 5 jaar ago

Solved


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; ...

meer dan 5 jaar ago

Solved


Add two numbers
Calculate the sum of two numbers. Example input = [2 3] output = 5

meer dan 5 jaar ago

Solved


Min of a Matrix
Return the minimum value in the given matrix.

meer dan 5 jaar ago

Solved


Rotate a Matrix by 90 degrees
Rotate a Matrix by 90 degrees Example: If the input is: X = 1 2 3 4 5 6 7 8 9 ...

meer dan 5 jaar ago

Solved


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

meer dan 5 jaar ago

Solved


The sum of the numbers in the vector
eg. [1,2,3]---->SUM=6

meer dan 5 jaar ago

Solved


Negative matrix
Change the sign of all elements in given matrix.

meer dan 5 jaar ago

Load more