Risolto


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

circa 6 anni fa

Problema


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

circa 6 anni fa | 0 | 143 risolutori

Problema


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

oltre 6 anni fa | 1 | 449 risolutori

Problema


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

oltre 6 anni fa | 2 | 65 risolutori

Problema


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

oltre 6 anni fa | 3 | 391 risolutori

Problema


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

oltre 6 anni fa | 7 | 324 risolutori

Problema


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

oltre 6 anni fa | 4 | 411 risolutori

Problema


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

oltre 6 anni fa | 1 | 457 risolutori

Problema


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

oltre 6 anni fa | 2 | 222 risolutori

Problema


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

oltre 6 anni fa | 2 | 181 risolutori

Problema


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

oltre 6 anni fa | 4 | 203 risolutori

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Problema


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

oltre 6 anni fa | 4 | 184 risolutori

Problema


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

oltre 6 anni fa | 2 | 479 risolutori

Problema


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

oltre 6 anni fa | 0 | 491 risolutori

Problema


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

oltre 6 anni fa | 1 | 568 risolutori

Problema


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

oltre 6 anni fa | 3 | 585 risolutori

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


inner product of two vectors
inner product of two vectors

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Risolto


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

oltre 6 anni fa

Carica altro