Gelöst


Placing Beads Neatly in a Box
You are given a string of n black and white beads. Your job is to pack them neatly into a square box. "Neatly" in this case mean...

mehr als 10 Jahre vor

Gelöst


Find 1's Complement
Find 1's complement of a binary number For Example: x = 10011010 1's complement of x = 01100101

mehr als 10 Jahre vor

Gelöst


Sum of Matrix
Sum of Matrix

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

Gelöst


Is It a Snake?
Given an m-by-n matrix, return true if the elements of the matrix are a connected "snake" shape from 1 to m*n. Otherwise return ...

mehr als 10 Jahre vor

Gelöst


prime to each other
Given two integers n1, n2 greater than 1, find out if they have common divisors or are prime to each other. Return "true" if the...

mehr als 10 Jahre vor

Gelöst


multiple of nine?
Given a positive number n, return true if n is a multiple of 9 and false if not. Do not make the division and do not use functio...

mehr als 10 Jahre vor

Gelöst


Find elements of set A those are not in set B
Given two sets of data A and B. Find elements of A those are not in set B. ...

mehr als 10 Jahre vor

Gelöst


Why the heck are they blinking!?!?
Merry Christmas everyone! Sadly, the lights you've had on your tree for so many years burned out, and it's time to get a new se...

mehr als 10 Jahre vor

Gelöst


sparse_matrix
You convert a vector to a sparse matrix. for example *x* =[1 2 3]; output will be *y* = [1 0 0 ...

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

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

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


Determine the full width at half max
Determine the full width at half max of a curve. The full width at half maximum (FWHM) is a parameter which is used for desc...

mehr als 10 Jahre vor

Gelöst


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

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


Histogram of histogram
Histogram of histogram (HoH) is a useful measure concerning the distribution of random data, which has diverse applications in d...

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


Longest Collatz Sequence
Inspired by Projet Euler n°14. The Collatz iterative sequence (See Cody problem n° 2103 and 211) is defined for the set of po...

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


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


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

fast 11 Jahre vor

Gelöst


Sum my indices
Given inputs M and N (in that order), output an MxN matrix whose entries are equal to the sum of their indices. Example input...

fast 11 Jahre vor

Gelöst


Find the Final State of an Abelian Sandpile
Let us define an <http://nautil.us/issue/23/dominoes/the-amazing-autotuning-sandpile Abelian sand pile> as a matrix that is only...

fast 11 Jahre vor

Gelöst


Your favourite city!
Type your favourite city.

fast 11 Jahre vor

Gelöst


Big Integer Multiplication
Implement big integer multiply. Input: A, B : N-by-M Matrix, each row represents a positive decimal integer. Output: ...

fast 11 Jahre vor

Gelöst


Maximum of each diagonal
The well-known <http://www.mathworks.com/help/matlab/ref/max.html max> function can operate along either the rows or the columns...

fast 11 Jahre vor

Gelöst


Make visible max values
Make visible maximum values of rows input = [1 2 3 4 5; 6 9 8 2 1; 2 1 4 5 8; 1 9 7 9 2]; ...

fast 11 Jahre vor

Gelöst


Create cell array of numeric arrays
Convert the input to a cell array, but only if necessary. If the input is a numeric array, return a 1-by-1 cell array contain...

fast 11 Jahre vor

Gelöst


Convert ColorSpec string to RGB triplet
Given a ColorSpec string, either in short or long form, return the corresponding RGB triplet. If the input is not a valid color,...

fast 11 Jahre vor

Mehr laden