Solved


Factorizing a number into a given number of factors
Given a positive integer, n, and another positive integer, b, return a matrix, M, of width b, with the following properties: (a)...

24 days ago

Solved


Addition Partition
You will be given two numbers, N and K. Write a MATLAB function that will determine how many different unique ways you can have...

24 days ago

Solved


Red and green towers
Frankie has a large number of wooden cubes, painted in red and green. He is building little towers with his cubes, by stacking t...

24 days ago

Solved


Recycled Numbers (CodeJam Qualification Round 2012)
Let's say a pair of distinct positive integers ( _n_ , _m_ ) is recycled if you can obtain _m_ by moving some digits from the ...

24 days ago

Solved


Sum of combinations
Input: *X = 40*, *Y = [40 20 10 4]* Output: *Z = [1 0 0 0; 0 2 0 0; 0 1 2 0; 0 1 1 3; 0 1 0 5; 0 0 4 0; 0 0 3 3; 0 0 2 5; 0 ...

24 days ago

Solved


Penny Flipping: Reverse subsets of a sequence of coins until you recover the original configuration
The original Penny Flipping Problem (PF-1) starts with a stack of N pennies arranged with all the coins heads up. The first oper...

24 days ago

Solved


Penny Distribution Machine
A machine consists of a row of boxes. To start, one places N pennies in the leftmost box. The machine then redistributes the pen...

24 days ago

Solved


List the households affected by leaks in water distribution
Consider the following water distribution network, where water is pumped uni-directionally from left to right: 8...

25 days ago

Solved


Place wastewater treatment processes in the correct order
There are many technologies for treating wastewater. For example, grit chambers are used to remove heavy solids, filtration is u...

25 days ago

Solved


Maximize the production in a plant within equipment capacity
The goal of a certain manufacturing company is to maximize its production of goods per day. In the production flow, there is a s...

25 days ago

Solved


Trace the path of a harmful chemical in an ecological network
An ecological network consists of the cycles of nature, such as the water cycle, the carbon cycle, the oxygen cycle, etc. Due to...

25 days ago

Solved


Count the number of reaction chains achievable in T mins
This problem is related to Problem <45467>. Let's denote a list of *N* compounds as 1, 2, ..., *N*. You are then given a list...

25 days ago

Solved


Find the fastest reaction chain to reach a target compound
This problem is related to Problem <45470>. Let's denote a list of *N* compounds as 1, 2, ..., *N*. You are then given a list...

25 days ago

Solved


Design a minimum-cost cable network for a power grid
You are given the 2-D point locations ( _xi_ , _yi_ ) of *N* _components_ of a power grid. These _components_ include power sour...

25 days ago

Solved


Propagate the effects of a blockage in a chemical plant
From the perspective of flow, a chemical plant can be described by a collection of _nodes_ and _edges_. _Nodes_ are points where...

25 days ago

Solved


Pitting corrosion on a metal plate: Find the largest pit
You are given an N x M matrix of _ones_ and _zeros_, which represents an image of a rectangular metal plate taken from the hull ...

25 days ago

Solved


Detect circles in images
Given an image and a target radius range, specified as [rmin rmax], find circles in the image. Your function should output an m-...

25 days ago

Solved


Index of neighbor pixel with steepest gradient
Unlike in various applications, where the gradient of a two dimensional matrix is calculated in x and y direction, the gradient ...

25 days ago

Solved


Convert RGB triplet to ColorSpec string
This is the inverse to <http://www.mathworks.com/matlabcentral/cody/problems/42612-convert-colorspec-string-to-rgb-triplet this ...

25 days ago

Solved


Check capital letters
Check if each first letter of a string is a capital letter. for example: 'This Is Ok' gives a true answer and 'This Is not Ok' ...

27 days ago

Solved


Create incremental spiral WITHOUT USING EVAL or FEVAL
Constructions that use feval or eval are used to cheat with cody. This test-suite tries to avoid that trick. The goal of this c...

27 days ago

Solved


Josephus Survivor
The <http://en.wikipedia.org/wiki/Josephus_problem Josephus Challenge> is to find the position that is the last remaining when e...

27 days ago

Solved


Coin distribution
Imagine, u r in a shop. ur bill is n(2200). u want to pay the bill with minimum no of coins u have. u've coins of - 2000,1000...

27 days ago

Solved


Concatenate input positive integers to obtain a maximum.
Input some integers, you need to concatenate them to obtain a maximum integer. Neither use library function "perms" to list all ...

27 days ago

Solved


Assign matrix elements to separate variables
Given an input array, return each element of the array as a separate variable. If the number of output arguments (k) is less tha...

27 days ago

Solved


Modified run-length companion vector
Given a vector x, return a vector that indicates the run length of any value in x. Each element in output vector shows how many ...

27 days ago

Solved


Convert binary numbers to hexadecimal numbers
Function must convert the input vector x composed of 0 and 1 (length is a multiple of 8) in hexadecimal. Most significant bit is...

27 days ago

Solved


Rank of magic square (for beginners)
Compute the rank r of a magic square of order n WITHOUT rank and magic functions.

27 days ago

Solved


Five-dimensional maze
*Description* The traditional maze is 2-dimensional: the navigator can move in the positive or negative directions along two ...

27 days ago

Load more