Solved

create a matrix y of size (n+1) whose last column's elements are the summation of the elements of all the other columns and last row's elements are the summation of the elements of all the other rows; where 'n' is the size of the input matrix 'x'.

for example x=[1 2 3;4 5 6;7 8 9] then y=[1 2 3 6; 4 5 6 15; 7 8 9 24; 12 15 18 45]

1 month ago

Solved

D'Hondt Method of Proportional-Representation

The D'Hondt method is a proportional representational method for allocating seats to parties in an election. <https://en.wiki...

1 month ago

Solved

Hamming Weight - Size Scoring

The Hamming Weight, <http://en.wikipedia.org/wiki/Hamming_weight wiki Hamming Weight>, in its most simple form is the number of ...

1 month ago

Solved

Fraction of a fraction of a ...

One sort of brainteaser problem is a math problem wherein you are asked what the given fraction of a fraction of a ... number is...

1 month ago

Solved

Find the nearest prime number

Happy 5th birthday, Cody! Since 5 is a prime number, let's have some fun looking for other prime numbers. Given a positive in...

1 month ago

Solved

Squares in Squares - Concentric Squares

Given a number, n, create an n x n sized matrix with concentric squares of 1s from the outside in. There should be a gap between...

1 month ago

Solved

Given a vector x, return vector y with all negative elements from the vector x.

Given a vector x, return vector y with all negative elements from the vector x if x has negative elements. Otherwise return 0. ...

1 month ago

Solved

square a number twice with square root of 4/5

square a number twice with square root of 4/5

1 month ago

Solved

Calculate the average value of the elements in the array

Calculate the average value of the elements in the array

1 month ago

Solved

the average value of the elements

Calculate the average value of the elements in the array

1 month ago

Solved

Convert base 10 to base x (2-16)

Convert input number(s) (double) in base 10 to base x (2 through 16). Output should be a cell of character arrays. Compute outpu...

2 months ago

Solved

Area of Triangle with Oblique Coordinates

Find area of triangle given points p1, p2, and p3 where the y-axes is w degrees counter clockwise from the x-axes. For exampl...

2 months ago

Solved

Create a "+" flag

Given two odd numbers, [m, n], return a matrix of size m x n which has all elements of the centre column and centre row set as 1...

2 months ago

Solved

Lights Out 15 - 5x5, broken buttons I

<https://en.wikipedia.org/wiki/Lights_Out_(game) Lights Out> is a logic game wherein all lights need to be turned off to complet...

2 months ago

Solved

RSA decryption

Decrypt a large integer string using RSA decryption given the public key (n) and private key (d). Convert the large integer decr...

2 months ago

Solved

RSA encryption using public key

Encrypt the message text by converting to uint8 matrix using UTF-8 representation. Convert uint8 matrix to a large integer strin...

2 months ago