Solved


Cannibal eating odd and even numbered men
There are N men in a queue. A cannibal eats either all odd-numbered or all even-numbered men in the queue at a time. In the fi...

5 years ago

Solved


Compute hamming distance between two binary vectors represented using lists of 1-byte numbers
Let v and u be vectors of the same size with 8-bit integers (0-255). We want to compute the number of bits where those vectors d...

5 years ago

Solved


Angles of the hands of a clock
For this problem, consider an analog (or at least continuous digital representation) of a clock. Our clock is a 12 hour clock w...

5 years ago

Solved


Concatenate a successive power matrix in a column matrix
Generate F = [M1 M^2 ... M^p] with M a matrix, without using for.

5 years ago

Solved


Sort the prime numbers in each row of a 3x3 matrix
Considering a 3x3 matrix A, sort the prime numbers of each row in ascending order. For exemple: input A=[5 8 2 4; ...

5 years ago

Solved


Vigenere cipher - be like Sherlock Holmes!
You're a young detective. Every detective needs a function to decrypt a vigenère cipher. It's a modification of a caesar cipher....

5 years ago

Solved


remove nans fast
There are several ways to locate and remove nans in a matrix, and return an 1d row vector. In this problem the challenge is ...

5 years ago

Solved


provide the numerical answer to these number questions...
return a row matrix containing the sorted numbers which answer the following questions: a) what is the first Knuth number to...

5 years ago

Solved


Find the index of nth maximum of a row vector of real numbers
Given a vector of real numbers x, find the index idx of _n_ th maximum value. If nth maximum occurs more than once, return the i...

5 years ago

Solved


For a rectangle, if x is the length and 2x is width. Then find out x from the area of the rectangle?
For a rectangle, if x is the length and 2x is the width. Then find out x from the area of the rectangle? if the area is equal...

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

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

5 years ago

Solved


OXO counting
Count the number of occurrences of "OXO" in rows, columns, diagonals and anti-diagonals. Example: >> board = ['OOX' ...

5 years ago

Solved


Tic Tac Toe Solver
Create a function that checks n number of tic tac toe boards housed in a 3x3xn matrix where the x's are represented as 1's (and ...

5 years ago

Solved


Question 1
Implement a function named q1 with one input argument named n. This function should return the multiplication of all odd numbers...

5 years ago

Solved


lucky
check whether n is a lucky number <https://oeis.org/A000959>

5 years ago

Solved


Best Problem Elections
When I am writing those words, there are 2002 problems on Cody. Many of them are simply wonderful. Do you remember which of them...

5 years ago

Solved


Arithmetic/geometric sequence, 50/50
a(1) = 0 a(2) = 1 a(2*N) = sqrt(a(2*N-1)*a(2*N+1)) a(2*N+1) = (a(2*N)+a(2*N+2))/2 given _n_ return _a(n)_

5 years ago

Solved


Usage of mkdir and copyfile
This Challenge is to copy a file into a new directory multiple levels below existing directory architecture. System appears ...

5 years ago

Solved


Plot Line Specifications
Create a line plot for function cos(x) where x is a vector of linearly spaced values going from 0 to input N with an increment o...

5 years ago

Solved


CowBoy
A group of cowboys standing in circle form. They have one gun. The first cowboy shoot the cowboy beside him (second one) and giv...

5 years ago

Solved


Homogeneous lines and points in 2D: problem 1
In high school we learn the line equation y = mx + c where m is the gradient and c is the intercept. However this form is prob...

5 years ago

Solved


Determine roll pitch yaw angles from a 3D rotation matrix
Consider an aerospace application where the world reference coordinate frame {W} and a body-fixed coordinate frame {B}. The ori...

5 years ago

Solved


Twists in 2D
So far we have represented the pose of an object in the plane using a homogeneous transformation, a 3x3 matrix belonging to the ...

5 years ago

Solved


Pose interpolation in 2D
Consider two poses represented by homogeneous transformation matrices: |T1| and |T2|. Write an algorithm to interpolate between...

5 years ago

Solved


Pose from bearing angles in 2D
A robot moving on the plane has a sensor that measures the bearing angle to two mapped landmarks, that is, the world frame coord...

5 years ago

Solved


Composing relative poses in 2D: problem 2
We consider a world reference frame denoted by {0} which has its x-axis pointing east and its y-axis pointing north. There i...

5 years ago

Solved


Poker Series 11: selectBestHand
The Poker Series consists of many short, well defined functions that when combined will lead to complex behavior. Our goal is t...

5 years ago

Solved


Poker Series 10: bestHand
The Poker Series consists of many short, well defined functions that when combined will lead to complex behavior. Our goal is t...

5 years ago

Solved


Poker Series 09: IsHighCard
The Poker Series consists of many short, well defined functions that when combined will lead to complex behavior. Our goal is t...

5 years ago

Load more