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...
2 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 ...
2 years 前
已解决
Flag largest magnitude swings as they occur
You have a phenomenon that produces strictly positive or negative results.
delta = [1 -3 4 2 -1 6 -2 -7];
Marching through thi...
2 years 前
已解决
How long is the longest prime diagonal?
Stanislaw Ulam once observed that if the counting numbers are arranged in a spiral, the prime numbers contained in it form a sur...
2 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...
Find the next prime number
Find the next prime number or numbers for given n. For example:
n = 1;
out = 2;
or
n = [5 7];
out = [7 11];
...
2 years 前
已解决
Make a vector of prime numbers
Input(n) - length of vector with prime numbers
Output(v) - vector of prime numbers
Example:
* n=1; v=2
* n=3; v=[2 3 5...
2 years 前
已解决
Largest Twin Primes
<http://en.wikipedia.org/wiki/Twin_prime Twin primes> are primes p1, p2 = p1 + 2 such that both p1 and p2 are prime numbers. Giv...