Community Profile

photo

Ngo Quang Hien


Active since 2019

Statistics

  • Draw Letters
  • CUP Challenge Master
  • Solver

View badges

Content Feed

View by

Solved


Swap the first and last columns
Flip the outermost columns of matrix A, so that the first column becomes the last and the last column becomes the first. All oth...

mer än 4 år ago

Solved


Inner product of two vectors
Find the inner product of two vectors.

mer än 4 år ago

Solved


Find all elements less than 0 or greater than 10 and replace them with NaN
Given an input vector x, find all elements of x less than 0 or greater than 10 and replace them with NaN. Example: Input ...

mer än 4 år ago

Solved


Vector creation
Create a vector using square brackets going from 1 to the given value x in steps on 1. Hint: use increment.

mer än 4 år ago

Solved


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 ...

mer än 4 år ago

Solved


Find max
Find the maximum value of a given vector or matrix.

mer än 4 år ago

Solved


Create a vector
Create a vector from 0 to n by intervals of 2.

mer än 4 år ago

Solved


Get the length of a given vector
Given a vector x, the output y should equal the length of x.

mer än 4 år ago

Solved


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

mer än 4 år ago

Solved


Roll the Dice!
*Description* Return two random integers between 1 and 6, inclusive, to simulate rolling 2 dice. *Example* [x1,x2] =...

mer än 4 år ago

Solved


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

mer än 4 år ago

Solved


Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
If _p_ is the perimeter of a right angle triangle with integral length sides, { _a_, _b_, _c_ }, there are exactly three solutio...

mer än 4 år ago

Solved


Draw a 'X'!
Given n as input Draw a 'X' in a n-by-n matrix. example: n=3 y=[1 0 1 0 1 0 1 0 1] n=4 y=[1 0 0...

mer än 4 år ago

Solved


Draw a 'Z'.
Given _n_ as input, generate a n-by-n matrix like 'Z' by _0_ and _1_ . Example: n=5 ans= [1 1 1 1 1 0 0 0 1 ...

mer än 4 år ago

Solved


Draw a 'N'!
Given n as input, generate a n-by-n matrix 'N' using 0 and 1 . Example: n=5 ans= [1 0 0 0 1 1 1 0 0 1 1 0 ...

mer än 4 år ago

Solved


Draw 'D'.
Draw a x-by-x matrix 'D' using 0 and 1. example: x=4 ans= [1 1 1 0 1 0 0 1 1 0 0 1 1 1 1 0]

mer än 4 år ago

Solved


Draw 'O' !
Given n as input, generate a n-by-n matrix 'O' using 0 and 1 . example: n=4 ans= [1 1 1 1 1 0 0 1 ...

mer än 4 år ago

Solved


Draw 'C'.
Given x as input, generate a x-by-x matrix 'C' using 0 and 1. example: x=4 ans= [0 1 1 1 1 0 0 0 ...

mer än 4 år ago

Solved


Draw 'J'
Given n as input, generate a n-by-n matrix 'J' using 0 and 1 . Example: n=5 ans= [0 0 0 0 1 0 0 0 0 1 0 0 ...

mer än 4 år ago

Solved


Draw 'B'
Draw a x-by-x matrix 'B' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 0 1 0 0 0 1 ...

mer än 4 år ago

Solved


Draw 'I'
Given n as input, draw a n-by-n matrix 'I' using 0 and 1. example: n=3 ans= [0 1 0 0 1 0 0 1 0] n=...

mer än 4 år ago

Solved


Draw 'F'
Draw a x-by-x matrix 'F' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

mer än 4 år ago

Solved


Draw 'H'
Draw a x-by-x matrix 'H' using 1 and 0. (x is odd and bigger than 2) Example: x=5 ans= [1 0 0 0 1 1 0 0 0 1 ...

mer än 4 år ago

Solved


Draw 'E'
Draw a x-by-x matrix 'E' using 1 and 0. (x is odd and bigger than 4) Example: x=5 ans= [1 1 1 1 1 1 0 0 0 0 ...

mer än 4 år ago

Solved


Volume Pillar
Calculate the volume of a pillar with radius l and heigth ar.

mer än 4 år ago

Solved


Convert radians to degrees
Given input in radians, output to degrees

mer än 4 år ago

Solved


Perimeter of a semicircle
Given the diameter d, find the perimeter of a semicircle

mer än 4 år ago

Solved


radius of a spherical planet
You just measured its surface area, that is the input.

mer än 4 år ago

Solved


Calculate area of sector
A=function(r,seta) r is radius of sector, seta is angle of sector, and A is its area. Area of sector A is defined as 0.5*(r^2...

mer än 4 år ago

Solved


Find my daddy long leg (No 's')
Given the ratio of the two legs (longer / shorter), and the hypotenuse length, find the value of the bigger leg.

mer än 4 år ago

Load more