Solved


Put m balls into n boxes (again)
According to <http://www.mathworks.com/matlabcentral/cody/problems/1516-put-m-balls-into-n-boxes Cody Problem 1516>, if I put 3 ...

12 years ago

Solved


Proper Factors
Generate the proper factors of input integer _x_ and return them in ascending order. For more information on proper factors, ref...

12 years ago

Solved


Removing rows from a matrix is easy - but what about inserting rows?
Assume A is a 5-by-5 matrix. A([2,4],:) = [] is a quick way to remove rows 2 and 4. Can you find a quick way to insert rows into...

12 years ago

Solved


count any radix?
given radix r(2-9), digts d(1-4), give all possible strings in sorted order. for example, if r=2, d=2, then output {'00' '01' '1...

12 years ago

Solved


Decimal Comparison
*Background* A utility of particular interest to Cody and other MATLAB ventures is comparing the equality of two numbers. In ...

12 years ago

Solved


factor to number
e.g. input number x=10 then it should produce y=25 or x=100 then y should be 2255. write a function or code to generate the same...

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

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

12 years ago

Solved


Snakes on a plane
Given the dimensions of a 2-d plane, create a matrix where a "snake" of ones occupies the plane from top left to bottom right. ...

12 years ago

Solved


Compress strings (not springs)
Please remove excess space, limit one space between others, and no space before punctuation marks. * For example, 'Trendy , ...

12 years ago

Solved


Minefield Sonar
*Background* In mine-hunting games (e.g. Microsoft Minesweeper), the user is provided with a covered grid that, upon a left c...

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

12 years ago

Solved


Create a cell array out of a struct
Create a cell array out of a (single) struct with the fieldname in the first column and the value in the second column: in: ...

12 years ago

Solved


Project Euler: Problem 5, Smallest multiple
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smalle...

12 years ago

Problem


Determine connected components of a graph
Adjacency matrix of an undirected graph is given. Return the number of connected components in the graph.

12 years ago | 3 | 79 solvers

Problem


Integer sequence - 2 : Kolakoski sequence
Get the n-th term of <https://oeis.org/A000002 Kolakoski Sequence>.

12 years ago | 6 | 202 solvers

Problem


Fermat's last theorem - again
For a given integer n, express it as a sum of two squares if possible. Return empty matrix otherwise. Solution may not be unique...

12 years ago | 1 | 41 solvers

Problem


Tribute to Ramanujan
The nth taxicab number, denoted as T(n), is defined as the smallest number that can be expressed as a sum of two positive algebr...

12 years ago | 1 | 32 solvers

Solved


GJam: 2013 China Event: Cannon Angle
This Challenge is derived from <http://code.google.com/codejam/contest/2933486/dashboard#s=p1 GJam 2013 China Captain Hammer>. T...

12 years ago

Solved


GJam 2013 Veterans: Hedge
This Challenge is derived from <http://code.google.com/codejam/contest/2334486/dashboard Hedgemony>. This is the Large data set ...

12 years ago

Solved


GJam 2014 China Rd A: Library Sorting (Large)
This Challenge is derived from <http://code.google.com/codejam/contest/2924486/dashboard#s=p2 GJam 2014 China Sorting>. Subset ...

12 years ago

Solved


GJam 2014 China Rd A: Library Sorting (Small)
This Challenge is derived from <http://code.google.com/codejam/contest/2924486/dashboard#s=p2 GJam 2014 China Sorting>. This...

12 years ago

Solved


GJam 2014 China Rd B: Sudoku Checker
This Challenge is derived from <http://code.google.com/codejam/contest/2929486/dashboard#s=p0 GJam 2014 China Sudoku>. Large Cas...

12 years ago

Problem


I want eval
A valid MATLAB statement containing a definition of a vector is passed as a string S. Determine the length of the vector. Inp...

12 years ago | 2 | 25 solvers

Problem


Neither minima nor maxima
Input v is a vector. Return all the elements of v which are not a local minimum or maximum. Example: v = [1 2 3 4 5] Ou...

12 years ago | 3 | 98 solvers

Solved


Generate this matrix
For a given odd integer n, generate a matrix as follows: Input: n = 5; Output: [ 2 1 0 0 0 1 ...

12 years ago

Problem


Generate this matrix
For a given odd integer n, generate a matrix as follows: Input: n = 5; Output: [ 2 1 0 0 0 1 ...

12 years ago | 4 | 168 solvers

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

12 years ago

Solved


Find the elements of a matrix according to a defined property.
From A = [5,2,3] and B = [1,2,3,4,5,6,7,8,9,10] produce a vector C where : C(1) is the sum of the first A(1) elements of B, ...

12 years ago

Solved


Polynomial division
Divide a polynomial u by polynomial v and return the quotients only. Example: u = x^4+3*x^3+5*x+3 v = x^2+1 Answer: ...

12 years ago

Load more