Gelöst


Polynomial Evaluation
Create a routine that takes a list of coefficients of a polynomial in order of increasing powers of x; together with a value of ...

etwa 10 Jahre vor

Gelöst


Distance a ball travels after throwing vertically
Calculate the total distance *'d'* (in meters) a ball would travel after *'s'* seconds and starting velocity of *'v'* (in m/s). ...

etwa 10 Jahre vor

Gelöst


Matrix of almost all zeros, except for main diagonal
Write a program to input an integer n and build a n-by-n matrix with the numbers 1,2,...,n on the main diagonal and zeros elsewh...

etwa 10 Jahre vor

Gelöst


Volume of a Parallelepiped
Calculate the volume of a Parallelepiped given the vectors for three edges that meet at one vertex. A cube is a special case ...

etwa 10 Jahre vor

Gelöst


We love vectorized solutions. Problem 1 : remove the row average.
Given a 2-d matrix, remove the row average from each row. Your solution MUST be vectorized. The solution will be tested for ac...

mehr als 10 Jahre vor

Gelöst


DC chopper
Input x is the sampled signal vector, may have both AC and DC components. output vector y should have AC components removed then...

mehr als 10 Jahre vor

Gelöst


Indexing the array: Shift right with variable sized arrays
* Write a statement to shift the array contents 1 position to the left. * Assign the rightmost element with -1. Ex: [12, 85...

mehr als 10 Jahre vor

Gelöst


Relational operators and row arrays: Run times
* Construct a row array fastRunTimes containing all elements of runTimes equal to or less than 480 seconds. Ex: If runTimes =...

mehr als 10 Jahre vor

Gelöst


What's the missing interior angle?
I'm talking about polygons... The sum of the interior angles of a triangle is 180 degrees. The sum of the interior angles of a...

mehr als 10 Jahre vor

Gelöst


Knight's Tour Checker
Given a matrix a, determine whether or not a legal <http://en.wikipedia.org/wiki/Knight's_tour knight's tour> is present. The kn...

mehr als 10 Jahre vor

Gelöst


For a given linear index as input for n sized square matrix, find corresponding row and column.
If input is 1, the row and column will be 1 and 1 respectively.

mehr als 10 Jahre vor

Gelöst


Can you reshape the matrix?
Given a matrix A, is it possible to reshape it into another matrix with the given number of rows?

mehr als 10 Jahre vor

Gelöst


Get all corner elements from a matrix where dimension of matrix is always equal to or greater than 2.
if a given matrix a = [1 2 3;4 5 6]; so answer is going to be [1 3;4 6]

mehr als 10 Jahre vor

Gelöst


7 segment LED display
Given a whole number, output how many segments would be lit up to display it on a 7 segment LED display (http://en.wikipedia.org...

mehr als 10 Jahre vor

Gelöst


Least common multiple of many numbers
1:6 -> 60

mehr als 10 Jahre vor

Gelöst


Find a subset that divides the vector into equal halves
Given a vector x, return the indices to elements that will sum to exactly half of the sum of all elements. Example: Inpu...

mehr als 10 Jahre vor

Gelöst


longest sequence of nans
In an array return the length of longest sequence of nans for each column. x = [ 2 3 1 2 5 6; nan nan 5 n...

mehr als 10 Jahre vor

Gelöst


If you prick us, do we not bleed?
While doing some quick sewing to fix up your child's Halloween costume, you accidentally jab your finger with the needle. Refle...

mehr als 10 Jahre vor

Gelöst


replace nan values iteratively.
replace nan values with the average of two neighbour non-nan value iteratively as follow; x = [2; 4; 6; nan; nan; nan; 10]; ...

mehr als 10 Jahre vor

Gelöst


Replace May with April
For instance, if the input is input_str = 'The flowers may bloom in April'; then the output is output_str = 'The flo...

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


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

mehr als 10 Jahre vor

Gelöst


Convert yards to feet
The goal of this script is to convert a value given in yards to feet.

mehr als 10 Jahre vor

Gelöst


Smith numbers
Return true if the input is a Smith number in base ten. Otherwise, return false. Read about Smith numbers at <http://en.wikipedi...

mehr als 10 Jahre vor

Gelöst


N-th Odious
Given index n return n-th <https://oeis.org/A000069 odious number>.

mehr als 10 Jahre vor

Gelöst


sort matrix
Given a matrix, sort it for each column, but cannot change the element of each row. for example input = [1 3; 2 4;1 5;3 6]; ...

mehr als 10 Jahre vor

Gelöst


Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n. Example For n = 2 then sum of squares = 5 (1^2 + ...

mehr als 10 Jahre vor

Gelöst


become the batman and save gotham!!!
:\\YOU ARE THE BATMAN//: Batman needs your help to save gotham city from its villains! One day while patrolling the streets...

mehr als 10 Jahre vor

Gelöst


Test Problem; Create a 5x5 array containing all ones
This is a test for learning the process of creating a Cody problem. The goal of this test problem will be to create an array,...

mehr als 10 Jahre vor

Gelöst


Generate the sum of Squares of the given number
|P(n) = 1^2 + 2^2 + ... + n^2| |P(1) = 1| |P(2) = 1 + 4 = 5;| |P(3) = 5 + 9 = 14;| |P(4) = 14 + 16 = 30;|

mehr als 10 Jahre vor

Mehr laden