Determine if given number is perfect
A number is <http://en.wikipedia.org/wiki/Perfect_number perfect> if it is equal to the sum of its factors, excluding itself.
...
Tell me the slope
Tell me the slope, given a vector with horizontal run first and vertical rise next.
Example input:
x = [10 2];
6年弱 前
解決済み
Sum the squares of numbers from 1 to n
For a given value of n return the sum of square of numbers from 1 to n.
Example
For n = 2
then sum of squares = 5 (1^2 + ...
Return 'on' or 'off'
When the input is true, return 'on', otherwise, return 'off'.
6年弱 前
解決済み
Box!
Given a box, find the volume of the cube. With each side = a.
6年弱 前
解決済み
Find the hypotenuse
Given a and b (the two sides of a right-triangle), find c, the hypotenuse.
6年弱 前
解決済み
Add two numbers
Calculate the sum of two numbers.
Example
input = [2 3]
output = 5
6年弱 前
解決済み
Back to basics 8 - Matrix Diagonals
Covering some basic topics I haven't seen elsewhere on Cody.
Given an input vector of numbers, output a square array with the...
Remove NaN ?
input -> matrix (n*m) with at least one element equal to NaN;
output -> matrix(p*m), the same matrix where we deleted the enti...
6年弱 前
解決済み
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...
6年弱 前
解決済み
Volume of a box
Given a box with a length a, width b, and height c. Solve the volume of the box.
6年弱 前
解決済み
Average of square wave
given positive and negative peak , calculate dc level, 50% duty cycle
6年弱 前
解決済み
Find number of days
The input is two date in string format (dd-mm-yyyy)
find out the number of days between these two dates.
Example:
input: ...
Is this is a Tic Tac Toe X Win?
For the game of <https://en.wikipedia.org/wiki/Tic-tac-toe Tic Tac Toe> we will be storing the state of the game in a matrix M.
...
約6年 前
解決済み
Spot the First Occurrence of 5
This problem series invites you to solve two simple problems related to the integer NUMBER FIVE, in order to celebrate <https://...
約6年 前
解決済み
Write c^3 as sum of two squares a^2+b^2
write c^3 as sum of two squares a^2+b^2. a and b must be integer and greater than zero.
For example
5^3 = 2^2 + 11^2
5...