N-Queens Checker
Picture a chessboard populated with a number of queens (i.e. pieces that can move like a queen in chess). The board is a matrix,...
2 years ago
Solved
Angle Between Analog Clock Hands
Given a datetime variable t, return the angle (in degrees) between the hour and minute hands of an analog clock at the time repr...
2 years ago
Solved
Fibonacci sequence
Calculate the nth Fibonacci number.
Given n, return f where f = fib(n) and f(1) = 1, f(2) = 1, f(3) = 2, ...
Examples:
Input...
2 years ago
Solved
Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input matrix, generate an output matrix that consists o...
2 years ago
Solved
Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4
So if n = 3, then return
[1 2 2 3 3 3]
And if n = 5, then return
[1 2 2 3 3 3 4...
2 years ago
Solved
Combined Ages 1 - Symmetric, n = 3
You have probably seen the common riddle wherein combined ages are provided and you must determine the individual ages. For exam...
Kepler's Equation
Solve <http://en.wikipedia.org/wiki/Kepler's_equation Kepler's Equation>.
Note that the solution is rounded down to 5 decima...
2 years ago
Solved
An Ohm's Law Calculator
*BACKGROUND / MOTIVATION:*
Many important observations in math and science can be described by short, but powerful, equations...
2 years ago
Solved
Multiply 2 numbers
Very easy, you just have to multiply 2 numbers
but you cannot use the following signs (*, /, - ,^) ,mtimes , times, cross, pro...
6 years ago
Solved
Swap two numbers
Example
Input:
a = 10
b = 20
Output
a = 20
b = 10