Community Profile

photo

Wei Shang


University of New Brunswick

Last seen: meer dan een jaar ago Active since 2012

Followers: 0   Following: 0

Message

Statistics

  • Solver

View badges

Feeds

View by

Solved


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

ongeveer 10 jaar ago

Solved


Counting Sequence
Given a vector x, find the "counting sequence" y. A counting sequence is formed by "counting" the entries in a given sequence...

meer dan 11 jaar ago

Solved


Tic Tac Toe FTW
Given a tic tac toe board: * 1 represents X * 0 represents empty. * -1 represents O It is X's move. If there is an imme...

meer dan 11 jaar ago

Solved


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

meer dan 11 jaar ago

Solved


Which doors are open?
There are n doors in an alley. Initially they are all shut. You have been tasked to go down the alley n times, and open/shut the...

meer dan 11 jaar ago

Solved


Back to basics 21 - Matrix replicating
Covering some basic topics I haven't seen elsewhere on Cody. Given an input matrix, generate an output matrix that consists o...

meer dan 11 jaar ago

Solved


Sum of diagonal of a square matrix
If x = [1 2 4; 3 4 5; 5 6 7] then y should be the sum of the diagonals of the matrix y = 1 + 4 + 7 = 12

meer dan 11 jaar ago

Solved


Return the first and last character of a string
Return the first and last character of a string, concatenated together. If there is only one character in the string, the functi...

meer dan 11 jaar ago

Solved


give nth decimal place of pi
max 15th place after the decimal point is ok for now

meer dan 11 jaar ago

Solved


Number of 1s in the Binary Representation of a Number
*Description* Return the number of 1s in the (unsigned integer) binary representation of a number. This function should be ab...

meer dan 11 jaar ago

Solved


Back to basics 7 - Equal NaNs
Covering some basic topics I haven't seen elsewhere on Cody. Given 2 input variables, output true if they are equal, false ot...

meer dan 11 jaar ago

Solved


Back to basics 1 - Saving
Covering some basic topics I haven't seen elsewhere on Cody. Given an input variable 'x', save it to disk in a file named 'co...

meer dan 11 jaar ago

Solved


Filter AC, pass DC
Input x is the sampled signal vector, may have both AC and DC components. Output vector y should not contain any AC component. ...

meer dan 11 jaar ago

Solved


Remove all the words that end with "ain"
Given the string s1, return the string s2 with the target characters removed. For example, given s1 = 'the main event' your ...

meer dan 11 jaar ago

Solved


Omit columns averages from a matrix
Omit columns averages from a matrix. For example: A = 16 2 3 13 5 11 10 8 9 7 ...

meer dan 11 jaar ago

Solved


All capital?
Are all the letters in the input string capital letters? Examples: 'MNOP' -> 1 'MN0P' -> 0

meer dan 11 jaar ago

Solved


Find the sum of the elements in the "second" diagonal
Find the sum of the elements in the diagonal that starts at the top-right corner and ends at the bottom-left corner.

meer dan 11 jaar ago

Solved


Summing Digits within Text
Given a string with text and digits, add all the numbers together. Examples: Input str = '4 and 20 blackbirds baked in a...

meer dan 11 jaar ago

Solved


Trimming Spaces
Given a string, remove all leading and trailing spaces (where space is defined as ASCII 32). Input a = ' singular value deco...

meer dan 11 jaar ago

Solved


Reverse Run-Length Encoder
Given a "counting sequence" vector x, construct the original sequence y. A counting sequence is formed by "counting" the entrie...

meer dan 11 jaar ago

Solved


Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next. Example input: x = [10 2];

meer dan 11 jaar ago

Solved


surface of a spherical planet
you just discovered its circumference, that is the input.

meer dan 11 jaar ago

Solved


Who knows the last digit of pi?
There is only one man who knows the last digit of pi, who is that man? Give the name of that man, who, by popular believe, can ...

meer dan 11 jaar ago

Solved


Getting the indices from a vector
This is a basic MATLAB operation. It is for instructional purposes. --- You may already know how to <http://www.mathworks....

meer dan 11 jaar ago

Solved


Given an unsigned integer x, find the largest y by rearranging the bits in x
Given an unsigned integer x, find the largest y by rearranging the bits in x. Example: Input x = 10 Output y is 12 ...

meer dan 11 jaar ago

Solved


Pattern matching
Given a matrix, m-by-n, find all the rows that have the same "increase, decrease, or stay same" pattern going across the columns...

meer dan 11 jaar ago

Solved


Arrange Vector in descending order
If x=[0,3,4,2,1] then y=[4,3,2,1,0]

meer dan 11 jaar ago

Solved


Balanced number
Given a positive integer find whether it is a balanced number. For a balanced number the sum of first half of digits is equal to...

meer dan 11 jaar ago

Solved


Factorize THIS, buddy
List the prime factors for the input number, in decreasing order. List each factor only once, even if the factorization includes...

meer dan 11 jaar ago

Solved


Project Euler: Problem 1, Multiples of 3 and 5
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23...

meer dan 11 jaar ago

Load more