Solved


Find the remainder - 01
Given an array of integers, find the remainder when the product of all the elements is divided by N

1 month ago

Solved


GJam: 2013 Rd1a Bullseye Painting
<http://code.google.com/codejam/contests.html Google Code Jam> 2013 Round 1a Bullseye challenge is to determine how many full ri...

1 month ago

Solved


String Logic 17
Examples: 'DIG' --> 'GDI' 'IMPORTANT' --> 'TANTIMPOR' 'DEAL' --> 'EALD' 'LIMB' --> 'IMBL' 'MOSTLY' --> 'YMOSTL'

1 month ago

Solved


Create a Cell array of month-end date strings within a provided date range
This is a variation of <http://www.mathworks.com/matlabcentral/cody/problems/1039-get-an-array-of-month-ends-in-a-date-range Get...

1 month ago

Solved


Easy Sequences 3: Prime 44-number Squares
The positive integers 62 and 238 are related. Their squares (3844 and 56,644) both end in '44'. In fact, 62 and 238 are the 3rd ...

1 month ago

Solved


Easy Sequences 11: Factorial Digits without Trailing Zeros
Here is an easy one... It is not difficult to count the number of digits of the factorial of a given number. For example for 'n...

1 month ago

Solved


Yet Another Path Finder
Assume there is a rectangular grid of points. These points are indicated by linear indices in a MATLAB-fashion. Some of the grid...

1 month ago

Solved


Better bullseye matrix
<http://www.mathworks.com/matlabcentral/cody/problems/18-bullseye-matrix Problem 18> asks to create a bullseye matrix like this:...

1 month ago

Solved


Spiral In
Create an m by n matrix filled with sequential integers starting from 1 and arranged in a counterclockwise spiral that hugs the ...

1 month ago

Solved


Fangs of pseudo-vampire number
given a number, find all the fangs of that number. A pseudo-vampire number can have multiple of fangs. The output should be a...

1 month ago

Solved


Pseudo-vampire number
refer to <https://en.wikipedia.org/wiki/Vampire_number> Given a number x, determine whether it is a pseudo-vampire number. A p...

1 month ago

Solved


Monte-Carlo integration
Write a function that estimates a d-dimensional integral to at least 1% relative precision. Inputs: * d: positive integer....

1 month ago

Solved


Cumulative maximum of an array
Find the cumulative maximum of an array without using the built-in function cummax (and a few others). Your function should act ...

1 month ago

Solved


Simulate one complete step in the Biham–Middleton–Levine traffic model
The <http://en.wikipedia.org/wiki/Biham%E2%80%93Middleton%E2%80%93Levine_traffic_model Biham–Middleton–Levine traffic model> is ...

1 month ago

Solved


Make a checkerboard matrix (★★★★★)
(copy of Prob. 4) Given an integer n, make an n-by-n matrix made up of alternating ones and zeros as shown below. The a(1...

1 month ago

Solved


Logic 1

1 month ago

Solved


Create Combination
Motivation: In many problems, we need to create combinations with the function nchoosek. In some cases, however, choices are lim...

1 month ago

Solved


Generate the Figure-Figure sequence
After discussing Scott Kim’s FIGURE-FIGURE Figure (below) in Gödel, Escher, Bach, Douglas Hofstadter introduced an integer seque...

1 month ago

Solved


Fraction of a fraction of a ...
One sort of brainteaser problem is a math problem wherein you are asked what the given fraction of a fraction of a ... number is...

1 month ago

Solved


Determine whether a number is a prime self number
Integers can be classified as generated numbers or self numbers. A generated number is one that can be expressed as the sum of a...

1 month ago

Solved


Tic-Tac-Logic - Solution Checker
<http://www.conceptispuzzles.com/index.aspx?uri=puzzle/tic-tac-logic/rules Tic-Tac-Logic> is a logic puzzle wherein a rectangula...

1 month ago

Solved


Beat the RNG - EASY

1 month ago

Solved


Magical Land
Mother Earth has gifted humanity a magical land to help all life on earth, in the shape of a n-sided regular polygon. You, bein...

1 month ago

Solved


Cache me Outside
The test suite includes a simple recursive Fibonacci sequence generator, but it's terribly inefficient. One simple method for im...

1 month ago

Solved


Get input and output variable names
Given a string representing a function header, return the variable names used for the inputs and outputs. For example if input ...

1 month ago

Solved


Determine digits of the Copeland-Erdos constant
<https://www.mathworks.com/matlabcentral/cody/problems/1477-champernowne-constant/solutions/new Cody Problem 1477> asks us to de...

1 month ago

Solved


Two fractions, one sum
Given a positive number x, write a MATLAB script that will tell you how many ways that the reciprocal of that number can be writ...

1 month ago

Solved


Fifteen Parity Check
The Matlab function fifteen initializes the 4x4 array with randperm(16), which produces 50% unsolvable puzzles. A <https://en.wi...

1 month ago

Solved


Swap the first and last columns (★★)
(copy of Prob 19) Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becom...

1 month ago

Solved


Cody Problems in French : Trouvez la logique Pt.1
On rentre x = 4 et il en sort y = 160. Trouvez la logique entre x et y, aidez-vous de la test suite. Bon courage. P.S: L'...

1 month ago

Load more