Solved


Remove the air bubbles from a vector
_*A reduced version of Problem 112*_ Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...

environ 4 ans ago

Problem


How many unique Pythagorean triples?
For a given integer |n|, return all <https://en.wikipedia.org/wiki/Pythagorean_triple Pythagorean triples> that inlude numbers s...

environ 4 ans ago | 0 | 132 solvers

Problem


Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

environ 4 ans ago | 1 | 386 solvers

Problem


Diagonal Pattern
For a positive integer |n|, return an |nXn| matrix |mat| such that the value of each element in row |i| and column |j| is given ...

environ 4 ans ago | 1 | 36 solvers

Problem


Product of Each Column
Given a matrix |mat| with |n| columns, return a row vector |v| of length |n|, where every element in |v| is the product of the |...

environ 4 ans ago | 3 | 378 solvers

Problem


Triangle of numbers
Create a matrix with the integers from 1 to |n| arranged in a triangular shape. Every row |i| of the matrix contains |i| inte...

environ 4 ans ago | 4 | 295 solvers

Problem


Find the average of a random sequance
Write a function that generates random integers within a loop, and calculates the mean of the positive numbers only. At each ...

environ 4 ans ago | 4 | 408 solvers

Problem


How many Integers?
Count the integers in a given vector |v|. You *must* use a loop to count each element separately. Examples: Input: v...

environ 4 ans ago | 1 | 445 solvers

Problem


Eye Squared
For a positive integer |n| create the identity matrix with |n| elements. In case it is not possible to produce an identity ma...

environ 4 ans ago | 2 | 204 solvers

Problem


Add a vector to a matrix
Given a matrix |mat| of size |mXn| and a row vector |v| of size |1Xs|, return a matrix with |m+1| rows that conatains |mat| over...

environ 4 ans ago | 2 | 177 solvers

Problem


Tax Calculator
Calculate the tax for a given income. 10% tax is paid for any income up to $2,000. 20% tax is paid for additional income u...

environ 4 ans ago | 4 | 189 solvers

Solved


Is this triangle right-angled?
Given any three positive numbers a, b, c, return true if the triangle with sides a, b and c is right-angled. Otherwise, return f...

environ 4 ans ago

Solved


The Glass Half Full
Identical glasses are placed in a triangular tower structure, such that the top level (L = 1) comprises one glass, the next leve...

environ 4 ans ago

Solved


Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
Submit your answer to this problem a multiple of 5 seconds after the hour. Your answer is irrelevant; the only thing that matte...

environ 4 ans ago

Solved


Energy of a photon
*&#9883 &#9762 &#9883 &#9762 &#9883 &#9762 &#9883* Given the frequency F of a photon in giga hertz. Find energy E of this...

environ 4 ans ago

Solved


How to subtract?
*&plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn &plusmn* * Imagine you need to subtract one...

environ 4 ans ago

Problem


Remove the air bubbles from a vector
_*A reduced version of Problem 112*_ Given a column vector v, return a vector w in which all the zeros have "bubbled" to the ...

environ 4 ans ago | 4 | 179 solvers

Problem


How many days in a month?
Return the number of days in a given month in 2017. If the input is not a valid month number, return -1. Examples: Input...

environ 4 ans ago | 2 | 461 solvers

Problem


Find the largest number
Given a vector v with 4 elements, find the largest number x. Example: Input: v = [4 7 1 6]; Output: x = 7; You mu...

environ 4 ans ago | 0 | 462 solvers

Problem


Sum of adjacent elements in a vector
Given a vector v, return a vector s containting the sum of every two adjacent elements in the vector. Every element s(i) cont...

environ 4 ans ago | 1 | 550 solvers

Problem


Remove the first, third and fifth rows of a matrix
Given a matrix x with at least five rows, return a matrix y that includes all rows of x except for th 1st, the 3rd and 5th. E...

environ 4 ans ago | 3 | 571 solvers

Solved


Indexed Probability Table
This question was inspired by a Stack Overflow question forwarded to me by Matt Simoneau. Given a vector x, make an indexed pro...

environ 4 ans ago

Solved


QWERTY coordinates
Given a lowercase letter or a digit as input, return the row where that letter appears on a <http://en.wikipedia.org/wiki/Keyboa...

environ 4 ans 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...

environ 4 ans ago

Solved


Is this number Munchhausen Narcissistic?
In this problem, simply return 1 if a supplied number is Munchhausen narcissistic or 0 if not. Example 153 is narcissistic...

environ 4 ans 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...

environ 4 ans ago

Solved


inner product of two vectors
inner product of two vectors

environ 4 ans ago

Solved


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

environ 4 ans ago

Solved


Make a Palindrome Number
Some numbers like 323 are palindromes. Other numbers like 124 are not. But look what happens when we add that number to a revers...

environ 4 ans 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...

environ 4 ans ago

Load more