A résolu


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

environ 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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.

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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]

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

A résolu


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

plus de 10 ans il y a

Charger plus