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

nästan 2 år ago

Solved

Find the longest sequence of 1's in a binary sequence.

Given a string such as s = '011110010000000100010111' find the length of the longest string of consecutive 1's. In this examp...

nästan 2 år ago

Solved

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. <<http://upload...

ungefär 2 år ago

Solved

Length of the hypotenuse

Given short sides of lengths a and b, calculate the length c of the hypotenuse of the right-angled triangle. <<http://upload....

ungefär 2 år ago

Solved

Side of a rhombus

If a rhombus has diagonals of length x and x+1, then what is the length of its side, y? <<http://upload.wikimedia.org/wikipe...

ungefär 2 år 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...

ungefär 2 år 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...

ungefär 2 år 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...

ungefär 2 år 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...

ungefär 2 år ago

Solved

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

ungefär 2 år 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...

ungefär 2 år ago

Solved

How long is the longest prime diagonal?

Stanislaw Ulam once observed that if the counting numbers are <http://en.wikipedia.org/wiki/Ulam_spiral arranged in a spiral>, t...

ungefär 2 år ago

Solved

Minimum Distance Point to Segment

This Challenge is to determine the minimum distance from a 2-D line segment defined by two points to a point. The point is (p...

ungefär 2 år ago

Solved

Dots in a Sphere

Return how many integer grid points there are inside a 3D sphere of radius _r_ centred at (0,0,0) (including points on the edge)...

ungefär 2 år ago

Solved

Dots in a Circle

Return how many integer grid points there are inside a circle of radius _r_ centred at (0,0) (including points on the edge). ...

ungefär 2 år ago

Solved

What is the distance from point P(x,y) to the line Ax + By + C = 0?

Given a point, P(x,y), find the distance from this point to a linear line. INPUTS: x, y, A, B, C OUTPUTS: d, the distance ...

ungefär 2 år ago

Solved

Angle between Two Vectors

The dot product relationship, a dot b = | a | | b | cos(theta), can be used to determine the acute angle between vector a and ve...

ungefär 2 år 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...

ungefär 2 år ago

Solved

Are you in or are you out?

Given vertices specified by the vectors xv and yv, and a single point specified by the numbers X and Y, return "true" if the poi...

ungefär 2 år ago

Solved

Circumscribed circles

Given the lengths of the 3 sides of a triangle, output the radius of the circumscribed circle. Example: [3 4 5] -> 2.5

ungefär 2 år ago

Solved

Do the lines intersect?

You are given two line segments. Do they cross? Consider one segment as (x1,y1) to (x2,y2), the other segment as (x3,y3) to (...

ungefär 2 år ago

Solved

Vector parallel to plane?

Given the coefficients of the equation which defines a plane as follows: ax+by+cz=d, return a boolean indicating whether the 2n...

ungefär 2 år ago

Solved

Pattern matching

Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

ungefär 2 år ago

Solved

Area of polygon

Given the vertices in vectors X,Y, return the area of the polygon they define.

ungefär 2 år ago

Solved

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

ungefär 2 år ago

Solved

Are all the three given point in the same line?

In this problem the input is the coordinate of the three points in a XY plane? P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) how can...

ungefär 2 år ago

Solved

Angle between two vectors

You have two vectors , determine the angle between these two vectors For example: u = [0 0 1]; v = [1 0 0]; The a...

ungefär 2 år ago

Solved

Parallel vectors

Return true or false depending on whether 2 vectors are parallel or not. Vectors can be 2 or 3 dimensional. The origin is not c...

mer än 2 år ago

Solved

Perimeter

Given a sequence of points forming a closed path (first and last points are coincident) return the perimeter value. For example...

mer än 2 år ago

Solved

Calculate the area of a triangle between three points

Calculate the area of a triangle between three points: P1(X1,Y1) P2(X2,Y2) P3(X3,Y3) these three points are the vert...

mer än 2 år ago