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 ...
約9年 前
解決済み
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...
Matrix multiplication across rows
Given matrix m, return matrix n such that, rows of n are result of multiplication of the rows of the input matrix
Example
...
a column vector to a row vector
Write a script to convert a column (e.g. x = [1; 2; 3]) to a row (e.g. y = [1 2 3]), your script should be able to do this for a...
約9年 前
解決済み
the odd elements
Write a function which extracts all the odd elements.
example
input: x = [1 8 9 45 -2 4]
output: y = [1 9 -2]
約9年 前
解決済み
a vector with a repeated entry
Create a row vector of length x, filled with 7's, for example, if x = 5
output = [7 7 7 7 7]
make sure to round UP when x ...
約9年 前
解決済み
complex numbers
For complex number z=a+bi, write code that will multiply a and b together.
約9年 前
解決済み
rounding
Round 5.46 and make 'y' equal to that number.
約9年 前
解決済み
square root
Write a script that returns the square root of the elements in x.
e.g. x = [1 4 9 16] --> y = [1 2 3 4]
Project Euler: Problem 7, Nth prime
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13.
What is the Nth prime nu...