Weighted average
Given two lists of numbers, determine the weighted average.
Example
[1 2 3] and [10 15 20]
should result in
33.333...
6 years ago
Solved
Pascal's Triangle
Given an integer n >= 0, generate the length n+1 row vector representing the n-th row of <http://en.wikipedia.org/wiki/Pascals_t...
6 years ago
Solved
Check if sorted
Check if sorted.
Example:
Input x = [1 2 0]
Output y is 0
6 years ago
Solved
Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x.
For instance if x=2 then y must be 1+2+3+4=10.
6 years ago
Solved
Find a Pythagorean triple
Given four different positive numbers, a, b, c and d, provided in increasing order: a < b < c < d, find if any three of them com...
6 years ago
Solved
Pangrams!
A pangram, or holoalphabetic sentence, is a sentence using every letter of the alphabet at least once.
Example:
Input s ...
Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so:
x = [1 2 3 4]
Commas are optional, s...
6 years ago
Solved
Pizza!
Given a circular pizza with radius z and thickness a, return the pizza's volume. [ z is first input argument.]
Non-scored bonus...