Tax Season ! How much is my salary?
Tax Season! I was employed for a period from x until y in a year and I get pay check of amount z on every alternate Friday of th...
19日 前
解決済み
Create an arrow matrix
An arrow matrix is a square matrix that contains ones on the diagonal, the last column, and last row.
...
19日 前
解決済み
Find Closest Constant
Given a number x, return the value that is closest to x from this list of constants: 0, 1, , e, , (also known as ).
For exampl...
19日 前
解決済み
Matrix Quadrants
Write a function that takes N as the input, and outputs a matrix whose upper-left (NxN) quadrant contains all ones, the lower-ri...
19日 前
解決済み
Guess Cipher
Guess the formula to transform strings as follows:
'Hello World!' --> 'Ifmmp Xpsme!'
'Can I help you?' --> 'Dbo J ifm...
19日 前
解決済み
Special matrix
Make a square matrix with this shape. For n=4
M =
1 1 0 0
1 0 1 0
0 1 0 ...
19日 前
解決済み
Magic is simple (for beginners)
Determine for a magic square of order n, the magic sum m. For example m=15 for a magic square of order 3.
19日 前
解決済み
Symmetric matrix
You must create a n-by-n symmetric matrix such that A(row,col) = row/col for col >= row.
Example if n =3 :
output is : A =
...
19日 前
解決済み
Pascal's Matrix
Given an integer n ≥ 0, generate the ( _n_+1) × ( _n_+1) lower triangular <http://en.wikipedia.org/wiki/Pascal_matrix P...
Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...
Flip the vector from right to left
Flip the vector from right to left.
Examples
x=[1:5], then y=[5 4 3 2 1]
x=[1 4 6], then y=[6 4 1];
Request not to use d...
19日 前
解決済み
Create a vector
Create a vector from 0 to n by intervals of 2.
19日 前
解決済み
Doubling elements in a vector
Given the vector A, return B in which all numbers in A are doubling. So for:
A = [ 1 5 8 ]
then
B = [ 1 1 5 ...
19日 前
解決済み
Find the nth composite number.
Everyone heard about the nth prime number. Let's try to find out the nth composite. For example , 1 is the first composite, 10 i...
Find nth maximum
Find nth maximum in a vector of integer numbers. Return NaN if no such number exists.
x = [2 6 4 9 -10 3 1 5 -10];
So
...
19日 前
解決済み
Find the logic and return the nth number
given a sequence of numbers arranged in the following order:
A=0,1,3,4,9,10,12,13,27,28,30,31,36,37,......
Write a function th...
19日 前
解決済み
Find nth number
The numbers 2 and 7 are called lucky numbers, an integer containing only the digits 2 and 7 is also called lucky number. The pro...