Gelöst


Create a vector
Create a vector from 0 to n by intervals of 2.

23 Tage vor

Gelöst


Flip the vector from right to left
Flip the vector from right to left. Examples x=[1:5], then y=[5 4 3 2 1] x=[1 4 6], then y=[6 4 1]; Request not to use d...

23 Tage vor

Gelöst


Whether the input is vector?
Given the input x, return 1 if x is vector or else 0.

23 Tage vor

Gelöst


Find max
Find the maximum value of a given vector or matrix.

23 Tage vor

Gelöst


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

23 Tage vor

Gelöst


Inner product of two vectors
Find the inner product of two vectors.

23 Tage vor

Gelöst


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

23 Tage vor

Gelöst


Find the next Fibonacci number
In the sequence of Fibonacci numbers, every number is the sum of the two preceding ones: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55...

23 Tage vor

Gelöst


Fibonacci sequence
Calculate the nth Fibonacci number. Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ... Examples: Input...

23 Tage vor

Gelöst


Find the Pattern 3

23 Tage vor

Gelöst


Find the Pattern 2

23 Tage vor

Gelöst


Find the Pattern 1

23 Tage vor

Gelöst


Square root
Given x (a matrix), give back another matrix, where all the elements are the square roots of x's elements.

23 Tage vor

Gelöst


Calculate the average value of the elements in the array
Calculate the average value of the elements in the array

23 Tage vor

Gelöst


to the 2 all elements
to the 2 all elements

23 Tage vor

Gelöst


calculate the length of matrix
input 1 array, calculate the length

23 Tage vor

Gelöst


Draw a '0' in a one matrix!

23 Tage vor

Gelöst


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

23 Tage vor

Gelöst


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

23 Tage vor

Gelöst


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

23 Tage vor

Gelöst


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

23 Tage vor

Gelöst


Side of a rhombus
If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<https://imgur.com/x6hT6mm.png>> ...

23 Tage vor

Gelöst


Area of an Isoceles Triangle
An isosceles triangle has equal sides of length x and a base of length y. Find the area, A, of the triangle. <<https://imgur...

23 Tage vor

Gelöst


Is this triangle right-angled?
Given three positive numbers a, b, c, where c is the largest number, return true if the triangle with sides a, b and c is right-...

23 Tage vor

Gelöst


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

23 Tage vor

Gelöst


Triangle sequence
A sequence of triangles is constructed in the following way: 1) the first triangle is Pythagoras' 3-4-5 triangle 2) the second...

23 Tage vor

Gelöst


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

23 Tage vor

Gelöst


Project Euler: Problem 6, Natural numbers, squares and sums.
The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385 The square of the sum of the first ...

27 Tage vor

Gelöst


Sum of first n terms of a harmonic progression
Given inputs a, d and n, return the sum of the first n terms of the harmonic progression a, a/(1+d), a/(1+2d), a/(1+3d),....

27 Tage vor

Gelöst


Project Euler: Problem 2, Sum of even Fibonacci
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 te...

27 Tage vor

Mehr laden