Solitaire Cipher
Implement the <http://en.wikipedia.org/wiki/Solitaire_(cipher) solitaire cipher>.
Since this is from Wikipedia, I am capturin...
11 years 前
已解决
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...
11 years 前
已解决
Find the biggest empty box
You are given a matrix that contains only ones and zeros. Think of the ones as columns in an otherwise empty floor plan. You wan...
11 years 前
已解决
Spot the outlier
All points except for one lie on a line. Which one is the outlier?
Example:
You are given a list of x-y pairs in a column ...
11 years 前
已解决
Make a run-length companion vector
Given a vector x, return a vector r that indicates the run length of any value in x. Each element in r shows how many times the ...
11 years 前
已解决
How many trades represent all the profit?
Given a list of results from trades made:
[1 3 -4 2 -1 2 3]
We can add them up to see this series of trades made a profit ...
Implement simple rotation cypher
If given a letter from the set:
[abc...xyz]
and a shift, implement a shift cypher.
Example:
'abc'
with a shi...
11 years 前
已解决
Remove the air bubbles
Given a matrix a, return a matrix b in which all the zeros have "bubbled" to the top. That is, any zeros in a given column shoul...
11 years 前
已解决
Too mean-spirited
Find the mean of each consecutive pair of numbers in the input row vector. For example,
x=[1 2 3] ----> y = [1.5 2.5]
x=[1...
11 years 前
已解决
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...