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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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年 前
解決済み
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...
約2年 前
解決済み
Mersenne Primes
A Mersenne prime is a prime number of the form M = 2^p - 1, where p is another prime number. For example, 31 is a Mersenne prim...